Just compiled 5.3.3 from source (win32).
Trying to test some header() stuff but it looks like it won’t work with CLI sapi.
Any good docs on putting your compiled source into apache as a module, just like i’d normally do with the pre-compiled module.
Basically my test would be from CLI
php -r "header('Content-Type: text/plain', true, 404); var_dump(headers_list());"
I get an empty array from headers_list() so I need to get this built source into apache so that i get a response from headers_list().
Thanks in advance guys.
——- UPDATE ——
Configure command, yet no apache just yet? http://pastebin.com/qhFVR8A3:
E:\phpsdk\bin\php53dev\vc9\x86\php5.3.3>configure --disable-all --enable-cli --enable-apache2-2handler --enable-apache2-2filter
Enabled SAPI:
-------------
| Sapi Name |
-------------
| cli |
-------------
—– 2nd UPDATE —-
Downloaded apache, stuck it in ../apache and tried the following command but can’t find the headers.
E:\phpsdk\bin\php53dev\vc9\x86\php5.3.3>
configure --disable-all --enable-cli --enable-apache2-2handler=../apache --enable-apache2-2filter --enable-cgi
—- 3rd Update —
Enabled SAPI:
--------------------
| Sapi Name |
--------------------
| apache2_2filter |
| apache2_2handler |
| cgi |
| cli |
--------------------
I have it working now.
E:\phpsdk\bin\php53dev\vc9\x86\php5.3.3>configure --disable-all --enable-cli --enable-apache2-2handler --enable-apache2-2filter --enable-cgi --with-extra-includes=E:\phpsdk\bin\php53dev\vc9\x86\apache\include --with-extra-libs=E:\phpsdk\bin\php53dev\vc9\x86\apache\lib
Thanks for the link
The PHP cli SAPI is not really meant to send HTTP headers; its purpose is to be used from the command line.
If you want to use PHP with Apache, you must compile the Apache module SAPI or the CGI SAPI.
To compile the Apache 2.2 module you must have the Apache libraries and include directories in %LIB% and %INCLUDE%, respectively, and use:
Notice that you go the Apache module route, you must compile it with against same version of the C runtime library that the Apache binaries use. The reason is that PHP must be able to allocate memory and pass those pointers to Apache for it to free them and vice-versa, and for that to happen correctly, the versions must be the same. So, for example, if you compiled (or downloaded from somewhere) Apache compiled with Visual C++ 9, you must use Visual C++ 9 to compile PHP.