Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2005
    Location
    Indiana, USA
    Posts
    20

    Question PHP Problems, please help.

    I am trying to install Apache/PHP on my windows machine at home so I can work offline. I got Apache installed, and I tried to install PHP (CGI binary) but I ran into a problem. The problem wasn't apparent until after the install. After the install was complete, I made a file called phpinfo.php and placed the following code inside of the file to make sure php was working correctly.
    PHP Code:
    <?php>
    phpinfo();
    ?>
    But when viewing http://localhost/phpinfo.php I see the code, and not the php information I should be seeing.

    This is the last few lines of my httpd.conf file.
    PHP Code:
    ...
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    #</VirtualHost>

    #ScriptAlias /php/ "c:/php/"
    #AddType application/x-httpd-php .php
    #Action application/x-httpd-php "/php/php-cgi.exe" 
    Any help is very much appreciated. If you need more information just let me know and I'll reply within minutes.

  2. #2
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    1)

    <?php
    phpinfo();
    ?>

    2)

    Uncomment (remove the #'s) from those lines in your httpd.conf file and restart Apache.
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  3. #3
    Join Date
    Aug 2005
    Location
    Indiana, USA
    Posts
    20
    I removed the the #'s on the last three lines, making it look like:
    PHP Code:
    ...
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    #</VirtualHost>

    ScriptAlias /php"c:/php/"
    AddType application/x-httpd-php .php
    Action application
    /x-httpd-php "/php/php-cgi.exe" 
    Now I get a 404 Not Found error, "The requested URL /php/php-cgi.exe/phpinfo.php was not found on this server." Do I need to uncomment every line in httpd.conf?

    Thanks for the help by the way.

  4. #4
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    Quote Originally Posted by mwalker
    I removed the the #'s on the last three lines, making it look like:
    PHP Code:
    ...
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    #</VirtualHost>

    ScriptAlias /php"c:/php/"
    AddType application/x-httpd-php .php
    Action application
    /x-httpd-php "/php/php-cgi.exe" 
    Now I get a 404 Not Found error, "The requested URL /php/php-cgi.exe/phpinfo.php was not found on this server." Do I need to uncomment every line in httpd.conf?

    Thanks for the help by the way.
    Try the following,

    ScriptAlias /php/ "c:/php/""
    AddType application/x-httpd-php .php
    Action application/x-httpd-php /php/php.exe or (php-cgi.exe if it's not php.exe)
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  5. #5
    Join Date
    Aug 2005
    Location
    Indiana, USA
    Posts
    20
    Now I get a "The requested opperation has failed" error. It only will start If I revert back to what I had before.

  6. #6
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    Quote Originally Posted by mwalker
    Now I get a "The requested opperation has failed" error. It only will start If I revert back to what I had before.
    Strange, is php instealled in c:\php ?
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  7. #7
    Join Date
    Aug 2005
    Location
    Indiana, USA
    Posts
    20
    No, everything is in c:\Server

    So PHP would be in c:\Server\PHP while Apache would be in c:\Server\Apache2

  8. #8
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    ScriptAlias /php/ "c:/Server/PHP/""
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php-cgi.exe"

    Make sure the paths are corrrect, or you could install it as a module:
    http://www.zend.com/manual/install.windows.apache2.php
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  9. #9
    Join Date
    Aug 2005
    Location
    Indiana, USA
    Posts
    20
    Every path is correct, and yet I still get that annoying "The requested operation has failed!" error.

    To install it as a module, am I going to need to uninstall php first? To uninstall php, do I just delete the directory and the php.ini file in my WINDOWS folder?

  10. #10
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    I'm not sure about that one, with Windows. If you installed PHP and have the .dll specified in the URL above then you should be able to go ahead and install it as a module.
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  11. #11
    Join Date
    Aug 2005
    Location
    Indiana, USA
    Posts
    20
    Alrighty then, thanks for all the help Pat.

  12. #12
    you don't want to use the CGI

    download the complete tarball not the auto installer

    proceed as installing a module, not CGI

    http://www.php.net/manual/en/install.windows.php

Posting Permissions

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