Click to See Complete Forum and Search --> : getting PHP 5 to work with Apache2


davidklonski
07-06-2004, 12:48 PM
Hello

I have installed PHP5 on my Windows XP machine.
I have also installed Apache2 and tried to get them both to work together.

I have added the following line to Apache's httpd.conf file:
LoadModule php5_module C:\php\php5apache2.dll
and also added the following lines:

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


I have written a small PHP script and placed it in the \htdocs directory of apache.
When I try to run it locally: http://localhost/test.php
I get the following error in Apache's log file:
[client 127.0.0.1] script 'C:\Program Files\Apache Group\Apache2\htdocs\test.php' not found or unable to stat

What could cause these problems?
It seems like Apache is not recognizing the PHP script.

thanks in advance

davidklonski
07-06-2004, 03:11 PM
I have noticed that when I comment the usage of the exension: extension=php_mysql.dll in php.ini, I get the following error when restarting Apache:
PHP Shutdown: Unable to load dynamic library 'c:\php\ext\php_mysql.dll' - The specified module could not be found.

I hope this will help someone locate my problem.

thanks in advance

davidklonski
07-06-2004, 06:53 PM
I am posting my httpd.conf file, in case someone will be able to let me know why Apache2 is not recognizing PHP on my computer.

help is appreciated

shavas
07-07-2004, 09:02 PM
move yah Apache install out of program files for a starts. I remember having problems with that. Php does not like spaces. All dirs should be below 8 chracters in length with no spaces. Some old dos hangover do occur in winblows enviroment

davidklonski
07-08-2004, 02:52 AM
I've managed to solve the problem.
Stupid me.
I used Notepad to create the index.php and Microsoft decided to add .txt at the end resulting with:
index.php.text which is of course not a php file and thus cannot be parsed by apache

rachel2004
07-08-2004, 03:04 AM
David, if you're editing under Windows, here is a decent text editor:

www.textpad.com

If you continue using Notepad, putting double quotes around your file name is one way to circumvent the .txt extension.

e.g.:

Save As > "myfile.php"

instead of:

Save As > myfile.php

The second way will, as you know, add .txt after .php.

davidklonski
07-08-2004, 03:08 AM
Actually I never use Notepad.
I just used it once to create the test page for a new computer which still didn't have any other decent text editor installed.
I usually use Zend Studio for working on my PHP files.

thanks for the feedback