Author |
|
smille20
Joined: 27 Jan 2010 Posts: 6 Location: Fort Hood, Texas
|
Posted: Thu 28 Jan '10 20:34 Post subject: Apache HTTP wont run after I edit the httpd.conf file |
|
|
I am trying to configure Apache to use PHP.
I was able to run Apache HTTP Server before I make changes on the conf file and I able to run Apache HTTP Sever when I comment out the lines I added to the file.
I was following the directions layed out in the following book, "Beginning PHP6, Apache, MySQL Web Development" by T Boronczyk, E Naramore, J Gerner, Y L Scouarnec, J Stolz, and M K Glass.
The lines I added are as follows:
After "AddType application/x-grip .gz .tgz"
I add:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:\Program Files\PHP"
After "#LoadModule vhost_alias_module modules/mod_vhost_alias.so"
I add:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll"
I restart the Apache Service and I get a error message and Apache will not start.
The error log reads
[warn] pid file C:/Program Files/Apache Software Foundation/Apache2.2/logs/httpd.pid overwritten -- unclean shutdown of previous pache run?
Am I entering the right lines to the file?
Should I be doing something different than "restarting" Apache? |
|
Back to top |
|
smille20
Joined: 27 Jan 2010 Posts: 6 Location: Fort Hood, Texas
|
Posted: Thu 28 Jan '10 21:32 Post subject: My second attempt |
|
|
I can get Apache HTTP Server running only when I comment out those lines I have added.
The error messages I that recieve are the same for both attempts.
"The requested operation has failed!" & "Apache HTTP Server stopped working and was closed."
This second attempt, I followed the instructions listed in the book, "Sams Teach Yourself PHP, MySQL and Apache All in One, 4th Ed." By Julie C Meloni.
After "#LoadModule vhost_alias_Module modules/mod_vhost_alias.so", I added:
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
PHPIniDir "C:/Program Files/PHP/"
Also after "AddType application/x-grip .gz .tgz", I added:
AddType application/x-httpd-php .php .html
AddType application/x-httpd-php-source .phps
I also restarted Apache after these changes. It still will not run even after I restart the PC. |
|
Back to top |
|
Brian White
Joined: 24 Aug 2008 Posts: 21
|
Posted: Fri 29 Jan '10 3:34 Post subject: |
|
|
You most likely are have incompatible version of Apache and PHP. Where did you get Apache from? Is it the VC6 or VC9 build? The same question applies to PHP. Where did you get it from? Is it the VC6 or VC9 build?
There are pointers to good tutorials on how to do this elsewhere on this site. I don't know the specific post but you can find them quickly if you search. |
|
Back to top |
|
smille20
Joined: 27 Jan 2010 Posts: 6 Location: Fort Hood, Texas
|
Posted: Fri 29 Jan '10 4:28 Post subject: |
|
|
I downloaded the PHP (5.3.1) from http://windows.php.net/
I used VC6 (the one mention to use for Apache)
I downloaded Apache from http://www.apache.org/
I used 2.2.14 win32 x86 openSSL 0.9.8k verison. |
|
Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7407 Location: EU, Germany, Next to Hamburg
|
Posted: Fri 29 Jan '10 12:37 Post subject: |
|
|
smille20 wrote: | I downloaded the PHP (5.3.1) from http://windows.php.net/
I used VC6 (the one mention to use for Apache)
|
Did you downlaod the thread safe or the non thread safe version? |
|
Back to top |
|
smille20
Joined: 27 Jan 2010 Posts: 6 Location: Fort Hood, Texas
|
Posted: Sat 30 Jan '10 1:20 Post subject: |
|
|
I downloaded the thread safe. I uninstall PHP today and was going to install the unthreaded one. I installed the threaded safe b/c the nonthread safe installer does not have the option of Apache 2.2.x module as your web server. |
|
Back to top |
|
smille20
Joined: 27 Jan 2010 Posts: 6 Location: Fort Hood, Texas
|
Posted: Sat 30 Jan '10 2:59 Post subject: |
|
|
I reinstalled PHP. This time I did it while Apache was stopped. It was able to access the config file but it only added:
" #BEGIN PHP INSTALLER EDITS -- REMOVE ONLY ON UNINSTALL
#END PHP INSTALLER EDITS -- REMOVE ONLY ON UNINSTALL"
I restarted Apache and it worked fine.
I stopped it and added my 3rd attempt in that section between the BEGIN and END.
What I added is this:
Loadfile "C:/Program Files/PHP/php5ts.dll"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
AddHandler application/x-httpd-php .php .html
AddHandler application/x-httpd-php-source .phps
#configure the path to php.ini
PHPIniDir "C:/Program Files/PHP/"
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
also my PC is running Vista x32 Business Edition. |
|
Back to top |
|
smille20
Joined: 27 Jan 2010 Posts: 6 Location: Fort Hood, Texas
|
Posted: Sat 30 Jan '10 7:14 Post subject: The solution! |
|
|
After "#LoadModule vhost_alias_module modules/mod_vhost_alias.so", I added the following:
LoadFile "C:/Program Files/PHP/php5ts.dll"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
<IfModule php5_module>
<Location />
AddType text/html .php .phps
AddHandler application/x-httpd-php .php .html
AddHandler application/x-httpd-php-source .phps
</Location>
</IfModule>
I found it at http://www.devside.net/articles/windows/php-apache22 |
|
Back to top |
|