Page 1 of 1
Confused NOOB Please Help
Posted: Sat Sep 08, 2007 1:43 am
by smmurph
I am trying to configure PHP and Apache in a Windows XP environment, but am having horrible problems that I can't figure out. I have set this up many times before but for some reason it is not working for me now. I have several books that guide through the process of loading both PHP5 and Apache, changing the php.ini and httpd.conf files, and I have followed everything to the "T", double and triple checked, but am having the same problem:
First of all, when I loaded Apache I tested it with localhost and received the "It Works" , so I know that Apache is set up correctly.
I created the htdocs file in the root of C: and placed a .php file in the folder and it won't read it. I have tried index.php, info.php, etc. The php file just has the <?php phpinfo(); ?> inside. When I save the file as index.php the web page at localhost just comes up blank. If I change the name of the file to info.php I get a page that has a large header that says "Index Of /" and then has a list of the files in the htdocs folder, one of which is info.php. When I click on the info.php file, again I get a blank webpage. Funny thing is if I saved a generic .html file it works just fine so it is only not parsing the .php files for some reason.
To the httpd.conf file:
I have the Document Root and directory changed to the htdocs file so that it is the new localhost folder, I added the "LoadModule php5_module c:/PHP/php5apache2_2.dll" as well, I added AddType application/x-httpd-php .php, and I tried to add a line that says PHPIniDir "C:/PHP/", however when I do Apache won't start up and givees an error, so I commented this out with #.
To the PHP.ini file I made all the necessary changes as well ... I did notice that with the new version of PHP the Dynamic extensions are no longer listed, but I added the ones that I needed manually as follows:
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_mysql.dll
extension=php_xsl.dll
extension=php_mysqli.dll
I am using the newest php (5.2.4) and Apache (2.2.4). Can anybody suggest to me why I cannot get Apahe to parse the PHP files?
Thanks,
Smmurph
Re: Confused NOOB Please Help
Posted: Sat Sep 08, 2007 8:47 am
by volka
smmurph wrote:and I tried to add a line that says PHPIniDir "C:/PHP/", however when I do Apache won't start up and givees an error, so I commented this out with #.
What error exactly would that be?
If you try index.php with
Code: Select all
<?php
echo ' >';
phpinfo();
?>
<p>test</p>
what is ithe output you see inthe brwoser?
Re: Confused NOOB Please Help
Posted: Sat Sep 08, 2007 10:22 am
by smmurph
volka wrote:smmurph wrote:and I tried to add a line that says PHPIniDir "C:/PHP/", however when I do Apache won't start up and gives an error, so I commented this out with #.
What error exactly would that be?
If you try index.php with
Code: Select all
<?php
echo ' >';
phpinfo();
?>
<p>test</p>
what is ithe output you see in the brwoser?
The error restarting Apache after adding the line PHPIniDir "C:/PHP/ to the httpd.conf file is "The requested operation has failed" ... when I comment out or remove the line from the .conf file Apache starts fine.
I tried the code that you asked me to try and I get a blank web page again. I copied it and pasted it directly to make sure is was exactly as you wrote it.
Also, I failed to mention above that I have checked the path in environment variables and it is fine as well.
Thanks,
smmurph
Posted: Sat Sep 08, 2007 11:18 am
by califdon
I'm not sure this is the entire problem, but in Windows, it needs to be a backslash:
Posted: Sat Sep 08, 2007 11:57 am
by volka
Neither apache nor php care about \ or /
smmurph wrote:"The requested operation has failed"
You've started the apache as service. A more detailed description of the error can be found in the system's event log. (start->run->%SystemRoot%\system32\eventvwr.msc /s). Or start httpd.exe from the console, startup errors will be printed there. Please look for the error message. Because if it says PhpIniDir is an invalid command it indicates that the php dll has not been loaded.
smmurph wrote:I tried the code that you asked me to try and I get a blank web page again. I copied it and pasted it directly to make sure is was exactly as you wrote it.
That's odd. Can you please try again without any php code in the file. Please make a new file test123.php with the contents
Code: Select all
<html><head><title>.#.#.</title></head>
<body>
test
</body>
</html>
Is anything displayed?
Posted: Sun Sep 09, 2007 1:48 am
by smmurph
volka wrote:Neither apache nor php care about \ or /
smmurph wrote:"The requested operation has failed"
You've started the apache as service. A more detailed description of the error can be found in the system's event log. (start->run->%SystemRoot%\system32\eventvwr.msc /s). Or start httpd.exe from the console, startup errors will be printed there. Please look for the error message. Because if it says PhpIniDir is an invalid command it indicates that the php dll has not been loaded.
smmurph wrote:I tried the code that you asked me to try and I get a blank web page again. I copied it and pasted it directly to make sure is was exactly as you wrote it.
That's odd. Can you please try again without any php code in the file. Please make a new file test123.php with the contents
Code: Select all
<html><head><title>.#.#.</title></head>
<body>
test
</body>
</html>
Is anything displayed?
Thanks Volka,
The Apache start problem was that there was already an entry for PHPIniDir at the end of the file so I was trying to add another .. makes sense to me!
I tried loading the HTML code that you asked me to load, saved the program as test123.php, and when I type in localhost/test123.php the page comes up empty, blank, nothing on it! This is really weird ... if I save with an .html file extension it comes right up!
I have totally removed PHP, MYsql and Apache, deleted all files, restarted and reloaded everything from scratch ... redid the php.ini and httpd.conf files, went through all the steps fresh, and still the same thing happens. This is so odd ... I have the exact same configuration on my laptop and PHP works just fine ... there has got to be something ... but I can't find it.
Smmurph
Posted: Sun Sep 09, 2007 10:07 am
by volka
If there is a key HKEY_LOCAL_MACHINE\SOFTWARE\PHP in your registry you should probably remove it
Is there something in the apache's error.log that might be related to the problem?
Please increase the
log level to
debug, restart the apache and try again.
Posted: Sun Sep 09, 2007 11:39 am
by smmurph
volka wrote:If there is a key HKEY_LOCAL_MACHINE\SOFTWARE\PHP in your registry you should probably remove it
Is there something in the apache's error.log that might be related to the problem?
Please increase the
log level to
debug, restart the apache and try again.
Volka,
Thanks Again for your assistance:
I removed the registry entry folder for PHP.
I went back and check the application log and noticed that when Apache performs its start up when I turn my machine on it gives this error message:
The Apache service named reported the following error:
>>> [Sun Sep 09 09:23:35 2007] [warn] module php5_module is already loaded, skipping
I changed the log level to debug, stopped and restarted Apache and here is what I get:
When I stop Apache I get 2 error messages and both of them shows the following:
Faulting application httpd.exe, version 2.2.4.0, faulting module php_iisfunc.dll, version 5.2.4.4, fault address 0x00001085.
When I restart Apache I still get the same error message:
The Apache service named reported the following error:
>>> [Sun Sep 09 09:23:35 2007] [warn] module php5_module is already loaded, skipping
Thanks again.
Smmurph
Posted: Sun Sep 09, 2007 2:41 pm
by volka
Do you have the line
in your php.ini?
Posted: Sun Sep 09, 2007 2:55 pm
by smmurph
volka wrote:Do you have the line
in your php.ini?
Yes, listed under :Local variables. I did notice tha this area seems to have changed. It used to be in the PHP.ini file that all the extensions were listed higher up and were just listed together without additional commands, however now they are all listed at the bottom of the file and are listed under another command that I do not understand, for instance:
[PHP_IISFUNC]
extension=php_iisfunc.dll
The code above never used to be there ... does this mean anything? All of them are this way, so when I added the php.ini for extension=php_mysql.dll, php_mysqli.dll, php_gd2.dll, etc. I did so in the section that the instructional walk throughs say to, the dynamic extensions area, and I don't know of what other code (if any) to put above. Does this make sense?
Thanks,
Smmurph
Posted: Sun Sep 09, 2007 3:42 pm
by volka
I suggest you comment out all extensions you do not need.
p.s.: E.g. the php installer adds all those sections for the extension modules.
Posted: Sun Sep 09, 2007 11:12 pm
by smmurph
volka wrote:I suggest you comment out all extensions you do not need.
p.s.: E.g. the php installer adds all those sections for the extension modules.
Volka,
Thanks again for your patient assistance! This took care of my problem!
Smmurph