Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 981343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:31:42+00:00 2026-05-16T04:31:42+00:00

Just compiled 5.3.3 from source (win32). Trying to test some header() stuff but it

  • 0

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.

http://pastebin.com/XyrzuZvu:

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:31:43+00:00Added an answer on May 16, 2026 at 4:31 am

    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:

    --enable-apache2-2handler
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've successfully built SDL from source using bcc 5.5.1 but any SDL test application
I'm new to Mono and just started recently. Is mono program are compiled from
I've just downloaded from SVN the DUnit2 code base. Does someone has compiled it
I've downloaded latest source from mono project, compiled it and everything works (c# projects,
I'm trying to derive a native class compiled from iCarousel native library ( used
I'm trying to use a few open source libraries like libpng in my VC++
I am running PHP 5.3.4 compiled from source with pcntl and posix. I did
I am trying to build MySQL's Connector/C from source in cygwin and there are
I'd like to do some stuffs before main function. I have multiple source files.
I'm trying to compile a set of .c files from an open source project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.