Results 1 to 9 of 9

Thread: PHP not working

  1. #1
    Join Date
    Apr 2002
    Location
    West Texas
    Posts
    1,777

    PHP not working

    I followed the link provided to me by jamesj for installing Apache and PHP and followed the instructions to install PHP but i can't get it working. I have C:\Apache Group and C:\php-4.2.0-Win32. I've renamed php.ini-dist to php.ini and movied it to C:\Windows and moved php4ts.dll file to C:\WINDOWS\SYSTEM32.

    I've then edited httpd.conf adding the following lines...

    ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"

    AddType application/x-httpd-php .phtml .php
    AddType application/x-httpd-php-source .phps

    Action application/x-httpd-php /php/php.exe

    Then created a php file with the following content..
    <? phpinfo() ?>

    saved to htdocs directory then restarted the Apache server. Localhost works fine but localhost/phpinfo.php gives me HTTP 404 - File not found. Am i missing something or doing something wrong here? Does php.ini need any modification? Doesn't say so in the instructions i followed.

    Big thanks for any help.

  2. #2
    Join Date
    May 2002
    Posts
    28
    mrmacca,

    Just out of curiosity... Try changing your directory "C:\php-4.2.0-Win32" to "C:\PHP4" and then modify your HTTPD.CONF and change this line:

    Action application/x-httpd-php /php/php.exe

    to this:

    Action application/x-httpd-php /php4/php.exe



    Let me know if that works....


    ...Frank

  3. #3
    Join Date
    Apr 2002
    Location
    West Texas
    Posts
    1,777
    Thanks, i'll give that a try later tonight, let you know if it works.

  4. #4
    Join Date
    Apr 2002
    Location
    .dk
    Posts
    1,691
    Are you sure that you've placed the phpinfo file in /htdocs and that it is called phpinfo.php? A 404-error simply means that Apache couldn't find the file. It will spit out other errors if PHP isn't working as far as I remember. You are also missing a "ScriptAlias /php/ "c:/php-4.2.0-Win32/"" entry.

    That point is rather moot though since I won't recommend that you set PHP up as CGI (the php.exe thing). Remove all the lines you mentioned above (except the ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/" one) and replace it with this:
    Code:
    LoadModule php4_module "c:/php-4.2.0-Win32/sapi/php4apache.dll"
    AddType application/x-httpd-php .php .phtml
    If that doesn't work then report back here with detailed error messages and such to help us figure out where it went wrong.
    "The ships hung in the sky in much the same way that bricks don't." --Douglas Adams

  5. #5
    Join Date
    Apr 2002
    Location
    West Texas
    Posts
    1,777
    Thanks again jamesj. I did actually have the line
    "ScriptAlias /php/ "c:/php-4.2.0-Win32/" and the phpinfo.php file was placed in the htdocs folder. Oh well. I've followed your instructions for the module and have a problem.

    Just so you know i started afresh, unsitalled Apache and delete the dll's. I installed Apache and PHP to the same directories listed before. I edited the httpd config, adding
    LoadModule php4_module "c:/php-4.2.0-Win32/sapi/php4apache.dll" and AddType application/x-httpd-php .php .phtml

    I copied the php4ts.dll and php.ini to the correct folders, namely \windows\system32 and \windows respectively. When i run http://localhost/phpinfo.php it tries to download phpinfo.php from localhost. I have no idea what's gone wrong. Any ideas?

    Frankie, tried your method and still received a HTTP 404 not found.
    Last edited by mrmacca; 05-15-2002 at 07:17 PM.

  6. #6
    Join Date
    Apr 2002
    Posts
    11
    What Version of Apache are you running ?
    -Munchen

  7. #7
    Join Date
    Apr 2002
    Location
    West Texas
    Posts
    1,777
    It's apache_1.3.24-win32-x86

  8. #8
    Join Date
    Apr 2002
    Posts
    3
    I had a problem with it trying to download the file before, cant remember exactly what it was I dont to fix it tho

    However, in the httpd.conf make sure you have

    LoadModule php4_module c:/php/sapi/php4apache.dll
    AddModule mod_php4.c
    AddType application/x-httpd-php .php
    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    Action application/x-httpd-php "/php/php.exe"

    Thats everythying i find in httpd.conf while searching for php and it works They are in order of being found look and see if you have all of those, or something similar, if not add it restart the server and then it -might- work
    www.jsa3d.co.uk | www.rrpg.co.uk << role playing custom trek universe.
    Head of Project Totally Confused and Lost

  9. #9
    Join Date
    Apr 2002
    Location
    West Texas
    Posts
    1,777
    Thanks calhoun, i'll have a look.

Posting Permissions

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