Confused NOOB Please Help
Moderator: General Moderators
Confused NOOB Please Help
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
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
What error exactly would that be?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 #.
If you try index.php with
Code: Select all
<?php
echo ' >';
phpinfo();
?>
<p>test</p>Re: Confused NOOB Please Help
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.volka wrote:What error exactly would that be?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 #.
If you try index.php withwhat is ithe output you see in the brwoser?Code: Select all
<?php echo ' >'; phpinfo(); ?> <p>test</p>
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
Code: Select all
C:/PHP/Code: Select all
C:\PHP\Neither apache nor php care about \ or /
Is anything displayed?
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:"The requested operation has failed"
That's odd. Can you please try again without any php code in the file. Please make a new file test123.php with the contentssmmurph 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.
Code: Select all
<html><head><title>.#.#.</title></head>
<body>
test
</body>
</html>Thanks Volka,volka wrote:Neither apache nor php care about \ or /
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:"The requested operation has failed"
That's odd. Can you please try again without any php code in the file. Please make a new file test123.php with the contentssmmurph 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.Is anything displayed?Code: Select all
<html><head><title>.#.#.</title></head> <body> test </body> </html>
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
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.
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,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.
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:
I changed the log level to debug, stopped and restarted Apache and here is what I get:The Apache service named reported the following error:
>>> [Sun Sep 09 09:23:35 2007] [warn] module php5_module is already loaded, skipping
When I stop Apache I get 2 error messages and both of them shows the following:
When I restart Apache I still get the same error message:Faulting application httpd.exe, version 2.2.4.0, faulting module php_iisfunc.dll, version 5.2.4.4, fault address 0x00001085.
Thanks again.The Apache service named reported the following error:
>>> [Sun Sep 09 09:23:35 2007] [warn] module php5_module is already loaded, skipping
Smmurph
Do you have the linein your php.ini?
Code: Select all
extension=php_iisfunc.dllYes, 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:volka wrote:Do you have the linein your php.ini?Code: Select all
extension=php_iisfunc.dll
[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
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.
Code: Select all
; extension=php_iisfunc.dllVolka,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.Code: Select all
; extension=php_iisfunc.dll
Thanks again for your patient assistance! This took care of my problem!
Smmurph