Edit report at https://bugs.php.net/bug.php?id=53721&edit=1

 ID:                 53721
 Comment by:         paulo230 at msn dot com
 Reported by:        martijn at thany dot nl
 Summary:            Upgrade breaks Apache config
 Status:             Open
 Type:               Bug
 Package:            Apache2 related
 Operating System:   Windows 2008 R2
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for solving that for me, it was INCREDIBLY STUPID AND FRUSTRATING !!


Previous Comments:
------------------------------------------------------------------------
[2011-01-23 17:20:08] kristjang at ffsn dot is

I just downloaded Apache 2.2.17 (x86 MSI installer) and PHP 5.3.5 (V6 x86 MSI 
installer). As mentioned by martijn, I had to edit httpd.conf and add the path 
to the PHP module. Even then, Apache will crash on startup if I have PHPIniDir 
enabled, with the error 

"[crit] (OS 6)The handle is invalid.  : master_main: create child process 
failed. Exiting.".

If I comment PHPIniDir out, Apache starts normally and loads .php files, 
however, according to phpinfo(), the "Configuration File (php.ini) Path" is set 
to "C:\WINDOWS" which doesn't contain any php.ini file. I had also set PHP's 
'error_log' but it doesn't seem to read my php.ini file.

------------------------------------------------------------------------
[2011-01-12 13:22:32] martijn at thany dot nl

Description:
------------
This happens basically everytime PHP is upgraded by simply executing the 
windows installer. The problem is that the apache config is modified (which is 
reallt not even neccesary in a minor upgrade), in a way that breaks apache.

This is what gets added:

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir ""
LoadModule php5_module "php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

This is plain WRONG, because this piece of config assumes php5apache2_2.dll to 
be in apache's installation directory, which it isn't. The installer installs 
it in "C:\Program Files (x86)\PHP", which is a totally different directory, 
obviously. This problem produces two consecutive errors in the event log, upon 
starting Apache:

>>> httpd.exe: Syntax error on line 426 of C:/Program Files (x86)/Apache 
>>> Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/Program Files 
>>> (x86)/Apache Software Foundation/Apache2.2/php5apache2_2.dll into server: 
>>> The specified module could not be fo     .

>>> und.     .

The solution is to include the path to the dll, like so:

LoadModule php5_module "C:/Program Files (x86)/PHP/php5apache2_2.dll"

This should (can can) be handled by the installer.

Also, second error is the PHPIniDir. It shouldn't be empty. That's WRONG as 
well, and produces the following error:

>>> PHPINIDir takes one argument, Directory containing the php.ini file     .

Why on earth would the installer produce such errors in the apache conf?? The 
solution, again, is to simply include the path to where php.ini has been put, 
which is almost always the installation dir:

PHPIniDir "C:/Program Files (x86)/PHP/"



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=53721&edit=1

Reply via email to