You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dave Dyer <dd...@real-me.net> on 2011/03/11 02:18:57 UTC

[users@httpd] problem loading mod_php

Versions:  Windows 7, Apache 2.2.17, PHP 5.3.5

If I start httpd as a console app, everything works correctly.  If I start as a
service, the php module fails to load.  Messages and actual behavior suggest
that the path is being treated strangely. 

Here are the relevant lines from httpd.conf

PHPINIDir "c:/program files (x86)/php/"
LoadModule php5_module "c:/program files (x86)/php/php5apache2_2.dll"

the error message when started as a service is:

httpd.exe: Syntax error on line 690 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 found.  

Note that the path in the message is to the apache root, not the path in the
config file.  And, if I put a copy of php5apache2_2.dll in the place designated
by the error message, it changes and the error becomes a complaint about the
syntax of the PHPINIDir line.

Syntax error on line 689 of C:/Program Files (x86)/Apache Software
Foundation/Apache2.2/conf/httpd.conf:

Note that the line number doesn't correspond to the location of the directive
in the conf file, and that the directive seems to be in the format the message
is complaining about.

Primary Question:  Ok, how do I get mod_php to load.

Secondary Question:

(1) How can it NOT be a bug that apache will actually load a module
from it's root directory instead of an explicitly named external directory.




Re: [users@httpd] problem loading mod_php

Posted by Hendrik Schmieder <he...@jedox.com>.
Dave Dyer schrieb:
>
> Versions: Windows 7, Apache 2.2.17, PHP 5.3.5
>
> If I start httpd as a console app, everything works correctly.
> If I start as a
> service, the php module fails to load.    Messages and actual behavior
> suggest
> that the path is being treated strangely.
>
> Here are the relevant lines from httpd.conf
>
> PHPINIDir"c:/program files (x86)/php/"
> LoadModule php5_module"c:/program files
> (x86)/php/php5apache2_2.dll"
>
> the error message when started as a service is:
>
> httpd.exe: Syntax error on line 690 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 found.
>
> Note that the path in the message is to the apache root, not the path in
> the
> config file.    And, if I put a copy of php5apache2_2.dll in the place
> designated
> by the error message, it changes and the error becomes a complaint about
> the
> syntax of the PHPINIDir line.
>
> Syntax error on line 689 of C:/Program Files (x86)/Apache Software
> Foundation/Apache2.2/conf/httpd.conf:
>
> Note that the line number doesn't correspond to the location of the
> directive
> in the conf file, and that the directive seems to be in the format the
> message
> is complaining about.
>
> Primary Question:    Ok, how do I get mod_php to load.
>

Maybe Apache can't find any dependencies like php5ts.dll.
Does it work if you start Apache from the commandline being in directory
C:/Program Files (x86)/Apache Software Foundation/Apache2.2/ ?

   Hendrik



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem loading mod_php

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 3/10/2011 7:18 PM, Dave Dyer wrote:
> 
> Versions:  Windows 7, Apache 2.2.17, PHP 5.3.5
> 
> If I start httpd as a console app, everything works correctly. 
> If I start as a
> service, the php module fails to load.  Messages and actual behavior
> suggest
> that the path is being treated strangely. 
> 
> Here are the relevant lines from httpd.conf
> 
> PHPINIDir "c:/program files (x86)/php/"
> LoadModule php5_module "c:/program files
> (x86)/php/php5apache2_2.dll"
> 
> the error message when started as a service is:
> 
> httpd.exe: Syntax error on line 690 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 found.  
> 
> Note that the path in the message is to the apache root, not the path in
> the
> config file.  And, if I put a copy of php5apache2_2.dll in the place
> designated
> by the error message, it changes and the error becomes a complaint about
> the
> syntax of the PHPINIDir line.

PHPIniDir may be ignored if you attempt to specify it before the LoadModule,
that's the way that subordinate directives behave in relation to their
respective modules.

If you have UAC enabled, as Eric suggests, perhaps you aren't modifying the
files you expected that you had?

> Syntax error on line 689 of C:/Program Files (x86)/Apache Software
> Foundation/Apache2.2/conf/httpd.conf:
> 
> Note that the line number doesn't correspond to the location of the
> directive
> in the conf file, and that the directive seems to be in the format the
> message
> is complaining about.
> 
> Primary Question:  Ok, how do I get mod_php to load.

Questions;

did you modify the system-wide PATH (as opposed to a user PATH), or the
PATH of the specific account you had set the Apache service to 'run-as'?

are you modifying the real C:/Program Files (x86)/Apache Software
Foundation/Apache2.2/conf/httpd.conf file?  If you have user account control on, system
resource
changes are ignored unless you do them from a console launched 'run as administrator'.

> Secondary Question:
> 
> (1) How can it NOT be a bug that apache will actually load a module
> from it's root directory instead of an explicitly named external directory.

It's a change to windows in it's processing of dependency directories, if you
review the history they claim it's a feature :)

There is a trick in httpd to help, it's LoadFile, which can load any arbitrary
.dll or .so from an absolute path, which a later LoadModule depends on.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem loading mod_php

Posted by Eric Covener <co...@gmail.com>.
> Note that the line number doesn't correspond to the location of the
> directive

Isn't there a Vista+ feature that makes your edits in Program Files/
only visible to your own userid?  Which is not usually the userid the
service runs under?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org