problems with loading php5 apache2 dll *solved* |
Site Admin
|
I'm not sure what apache and php distributions you use and why it is all posted in this forum
If you need Apache2 + php4, just take a look at NuSphere Techplatform 4.4. |
||||||||||||
|
|
I'm using standard Apache 2.20 which is already installed and configured on my WinXP system. It didn't stike me as odd to think that rather than replacing my current installation (which provides web support for other non-php development projects) I could point Apache2 at the Nusphere PhpEd 4.5 php5 installation I purchased last week ... and expect the dlls to load.
|
||||||||||||
|
|
What I hoped to find out by posting was whether anyone was familiar with this error. When an initial set of web searches didn't turn up a clear explanation on the web I decided to try this forum thinking that I might find someone who was familiar with it. I never meant to suggest that NuSphere's PHP distribution was worse or different from that of the official distribution. As for dll replacement, when the original php5apache2.dll didn't load I replaced it with the one shipped with PHP to see if there was any difference in behavior. There wasn't so I returned to the NuSphere dlls.
I have run PHP4 with Apache2 in the past (pre NuShpere) both as a binary (via ScriptAlias) and as via LoadModule. I haven't run PHP5 which I'm only now switching to because of its improved MySQL connection support. What is interesting is that after installing NuSphere PHP I am no longer able to use LoadModule with Apache2. Both php4apache2.dll (if configuring for php4) and php5apache2.dll (for php5) fail with the 'garbled' error I reported at the beginning of this thread. Please understand that I'm not pointing fingers at NuSphere but I am wondering what changed. I can and will return to using a PHP binary if I have to but in the meantime I'd like to try to understand why a common load methodolgy like this is failing. |
||||||||||||
|
Site Admin
|
Actually, you're wrong here not because phped has anything wrong, it's just Windows dll loading scheme. For Apache's process current directory is where httpd.exe (apache.exe) is. Windows first tries to load dll from System32, then from the process current directory, then from directories listed in the PATH. You might wonder at this point why it couldn't load php5apache2.dll you pointed directly. The correct answer is that even though you supplied path to php5apache2.dll and it's there, Windows can not find php5ts.dll that php5apache2.dll uses. Similarly it won't load for example php_mysql.dll because this dll is in extensions dir while libmysql.dll it's linked with is in the upper directory and that's why libmysql.dll won't be found until this upper directory is the process's current directory or listed in the PATH. To get it working you have to either a) copy all the dlls into Apache bin directory or b) add path to php5 and php5\extensions to windows PATH list and reboot computer. Don't forget that normally Apache runs under LOCAL SYSTEM account and therefore you should update PATH for SYSTEM, not for current user
never use it just surround library file name with quotes , for example "C:\program files\apache group\apache\modules\php5apache2.dll" |
||||||||||||||||
|
|
Hmm. Thanks for the thoughtful answer but I'm not sure you're correct.
// Path output trimmed for clarity PATH=C:\Program Files\nusphere\phped\php5\ // dll listing trimmed for clarity C:\Program Files\nusphere\phped\php5>dir *.dll Volume in drive C has no label. Volume Serial Number is 44E7-4079 Directory of C:\Program Files\nusphere\phped\php5 01/11/2006 05:15 PM 1,069,056 libmysql.dll 02/06/2006 07:47 PM 53,319 php5activescript.dll 01/11/2006 05:14 PM 36,924 php5apache.dll 01/11/2006 05:14 PM 36,925 php5apache2.dll 01/11/2006 05:14 PM 53,314 php5apache_hooks.dll 01/11/2006 05:14 PM 28,731 php5isapi.dll 01/11/2006 05:14 PM 28,731 php5nsapi.dll 01/11/2006 05:14 PM 4,411,448 php5ts.dll // Load module directive in httpd.conf LoadModule php5_module "C:/Program Files/nusphere/phped/php5/php5apache2.dll" // Apache2 httpd finds php5_module because of direct reference in httpd.conf $ httpd -S httpd.exe: Syntax error on line 119 of C:/Program Files/Apache2/conf/httpd.conf: API module structure `php5_module' in file C:/Program Files/nusphere/phped/php5/php5apache2.dll is garbled - perhaps this is not an Apache module DSO? // Test moving to bin as you suggest $ cp php5apache2.dll "C:/Program Files/Apache2/bin" // Adjusted LoadModule in httpd.conf LoadModule php5_module php5apache2.dll // Apache2 httpd can't find the dll in bin $ httpd -S httpd.exe: Syntax error on line 119 of C:/Program Files/Apache2/conf/httpd.conf: Cannot load C:/Program Files/Apache2/php5apache2.dll into server: The specified module could not be found. // Move dll to Apache2 dir $ mv "C:/Program Files/Apache2/bin/php5apache2.dll" "C:/Program Files/Apache2" // Apache2 httpd finds the dll but still 'garbled' $ httpd -S httpd.exe: Syntax error on line 119 of C:/Program Files/Apache2/conf/httpd.conf: API module structure `php5_module' in file C:/Program Files/Apache2/php5apache2.dll is garbled - perhaps this is not an Apache module DSO? PS. My tests with dos format PROGRA~1 were just to see if the bahavior differed. It didn't so I switched back to quotes. |
||||||||||||
|
Site Admin
|
you can not check PATH this way.
Apache runs before you log in and its PATH is taken from the SYSTEM PATH, not user's PATH variable. Please double check SYSTEM environment variable: Right click on My Computer, Advanced tab, Environment Variables button, System Variables list (on the bottom). Oh, just got it. You're using 2.2, not 2.0 Sorry for misleading
^^^^^^^ it's from Apache web site (http://httpd.apache.org/download.cgi ) Php5 that comes with phped is 100% win32 distro created by PHP Group. We did not change the binaries. If you need php debugger and have php already installed, just add php_dbg.dll module according to instructions on FAQ forum. |
||||||||||||||
|
|
Now I'll say 'solved'.
It’s a drag that I missed the Apache warning about the 2.0/2.2 add-in incompatibilities. No doubt there will eventually be 2.2 compatible dlls distributed with PHP. In the meantime there are two solutions to the ‘garbled’ problem: 1. Roll back to Apache to 2.0 2. Install Apache 2.2 compatible dlls available at Thanks Dmitri for the persistence and the sharp eyes. |
||||||||||||
|
Site Admin
|
they (I mean apache group) could implement module loader more user-friendly... At least they could put version number first in the DSO struct and check it first after module is loaded, then make decision if version is not compatible and warn about it, not misleading "garbled".
regarding 2.2, it's still possible to run php as CGI module and it will work good I think. |
||||||||||||
|
|
Yes, I'm sure you're right about the CGI modules and you probably won't be surprised to hear that I'll second (and third) your suggestion that they provide an improved naming convention and error messages.
For what its worth I have been running the Apache Lounge dlls (see my last post) with 2.2 for the last hour and all is well. Thanks again! |
||||||||||||
|
problems with loading php5 apache2 dll *solved* |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by