Do I need to compile Apache with mod_headers in order to manipulate headers in PHP?

Posted on 2009-04-29
Last Modified: 2013-12-13

Do the installed Apache modules influence what PHP functions are usable? For instance, if I disable mod_expires, mod_negotiation and mod_headers, can I still manipulate headers with PHP using header()? Also, if I disable mod_so, can I dynamically load PHP extensions, like inside php.ini?

I am installing Apache 2.2.11.

Question by:tomp_gl
    LVL 5

    Assisted Solution


    you should be able to use the header() function those modules are usefull for apache directives from .htaccess and other contexts (read more here: )

    you need mod_so to "Loading of executable code and modules into the server at start-up or restart time" more details here: so basically you could load PHP as a dynamic module if it was build that way.  So you should be able to load your extension from php.ini. Nevertheless you should test everything works as expected

    Accepted Solution

    Thanks for responding. I found that mod_headers etc were not needed to manipulate headers in PHP with header().

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now