Results 1 to 3 of 3
  1. #1

    Problems running PHP in Apache

    Hi, I've just installed PHP as a cgi-binary. I've gotten this to work at the command line prompt without any problems. However for some strange reason, I can't get any PHP pages to show up in the browser. They just try to open/save.

    Does anyone know what I have to do (probably to my httpd.conf in Apache) to get PHP scripts to run, even though they are installed as a CGI-binary?



  2. #2
    Join Date
    Jul 2002
    Sydney, Australia
    did you modify the httpd config file correctly as it says in install.txt

    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php.exe"

    i neva insteled PHP as a cgi but iv always found the PHP install.txt quite good and easy to follow.

    If you wish to install PHP as a CGI binary, (the sapi is much better)
    you need to enable the apache security fix in your php.ini by
    setting cgi.force_redirect = 1. Then, insert these lines to your conf file:

    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php.exe"

    Please note that you cannot use php-cli.exe with your webserver. You have
    to use php.exe which can be found in the sapi directory of your
    PHP distribution.

    Note, we consider installing PHP like this suicidal.

    As a further precaution, we recommend you change the "/php/"
    ScriptAlias to something more random, to prevent any attempts to
    call your binary (like the Code Red scripts) for returning a response
    other than 404.
    <Pig> Whats Linux?
    <Khaless> Oh dear...
    <Spork> Thats one ignorant Porker

  3. #3
    Yes, I don't like this installation either. But this is an in house development only thing, and also, our Apache build is complaining about aspx. They don't want to fix this so they just installed it as a CGI binary.

    However, they failed to get it to run in the browser. Oh, btw, I'm using Linux, so is there differenting things I need to add to httpd.conf ?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts