Click to See Complete Forum and Search --> : cannot load php4apache.dll in apache
I got a problem starting apache with php4 in Win98. Apache had problem when loading the php4apache.dll module. Funny thing is I install apache,php4,mysql on Win2K with the same setting, without any problem. But in windows 98, just it just wont work! Why!!! ????
Thank you for any help, Please..
mithril
07-06-2001, 12:59 AM
Wyang,
You'll have to give us a little more info about your current setup if you want to get more specific help. That being said..... here's my suggestion (I'll assume that you've installed Apache into c:\apache and PHP into c:\php):
1. Make sure you've followed the instructions for installing PHP:
- copy php.ini to c:\windows and make the changes you deem necessary
- copy all the librarys from c:\php\dlls to c:\windows\system
2. Copy php4apache.dll to c:\apache\modules and php4ts.dll to c:\windows\system
3. Edit your autoexec.bat file, adding c:\apache to your %PATH% statement
4. Add the following line to httpd.conf:
LoadModule php4_module modules/php4apache.dll
5. Restart Apache.
You may also need to restart Windows. If Apache still won't load the module, try moving php4ts.dll to c:\windows\system. This is the setup I use to run PHP as an Apache module on Win98. HTH,
Cheers,
Geoff A. Virgo
I just got this same message after doing the install.txt steps that Geoff outlined... except for one problem.
php4apache.dll was not included in the binary distribution...doh!
wondering now what else is missing.
Geoff A. Virgo wrote:
-------------------------------
Wyang,
You'll have to give us a little more info about your current setup if you want to get more specific help. That being said..... here's my suggestion (I'll assume that you've installed Apache into c:\apache and PHP into c:\php):
1. Make sure you've followed the instructions for installing PHP:
- copy php.ini to c:\windows and make the changes you deem necessary
- copy all the librarys from c:\php\dlls to c:\windows\system
2. Copy php4apache.dll to c:\apache\modules and php4ts.dll to c:\windows\system
3. Edit your autoexec.bat file, adding c:\apache to your %PATH% statement
4. Add the following line to httpd.conf:
LoadModule php4_module modules/php4apache.dll
5. Restart Apache.
You may also need to restart Windows. If Apache still won't load the module, try moving php4ts.dll to c:\windows\system. This is the setup I use to run PHP as an Apache module on Win98. HTH,
Cheers,
Geoff A. Virgo
ok, so i found that from the SAMS book, I needed to use the zip file vs. the msi install file. the msi was not complete.
the php4apache.dll file was in there, but as noted by Geoff, you must point httpd.conf to the path. if you receive a "load module" error. make sure that this line:
LoadModule php4_module modules/php4apache.dll
is quoted:
LoadModule php4_module "modules/php4apache.dll"
I believe there was a type on the install.txt which the apache daemon catches upon parsing.
I have this problem of not having this file, can you explain how to manage to get this file in detail and the installation process?
thanks
As I noted previously, if you're trying to use the .msi file, dont :)
use the zipfile , you can get it here:
http://www.php.net/downloads.php
use THIS one:
***********************
PHP 4.0.6 zip package [4,859Kb] - 23 June 2001
(CGI binary plus server API versions for Apache, AOLserver, ISAPI and NSAPI. MySQL support built-in, many extensions included, packaged as zip)
***********************
Do NOT use *pl* versions. only use stable versions.
also, i will assume you are saying that you want to install it on a windows machine, no?
Please list all your specs, etc, i.e., where is APache installed, what does your current httpd.conf file look like (have you made changes) etc etc etc.
hmm, ok, i guess i cannot edit, but i forgot to add, the zip file "should" have that dll file. hell, all packages released should have that file, but oh well, some are omitted...whatcha gonna do? its free :)
mithril
11-30-2001, 11:38 PM
Actually..... they are in the process of updating that silly installer so it will have a full copy of all the extensions. It's still not going to configure Apache though. Really when it all comes down to it, if you want to use the language on a real server (ie Apache), you're going to have to learn how to do a real install:)
-geoff
Aye tis true, tis true. I wouldnt even consider the IIS route myself. When the Nimbda or Sircam (cant remember which) was around, it was trying to access me, but I just put a blank file in the base dir and problem solved, thx apache :)
command line and .conf editing should and will probably remain the best way of maintaining an http daemon.
Geoff A. Virgo wrote:
-------------------------------
Actually..... they are in the process of updating that silly installer so it will have a full copy of all the extensions. It's still not going to configure Apache though. Really when it all comes down to it, if you want to use the language on a real server (ie Apache), you're going to have to learn how to do a real install:)
-geoff
i still get that error. I have apache 1.3 running on win200 pro, and I'm trying to load that php4 module. I have the following string in my config file:
LoadModule php4_module "modules/php4apache.dll"
yet i'm still getting the load module error.
any suggestions?
TIA
-- A
are you sure the DLL is there?
Not only does the line have to be quoted correctly as i stated, the dll has to BE there too =)
also, can you please copy verbatim any and all msg errors on the screen.
also goto err.log <-- i think that's the file and that also gives you a little more info on troubleshooting.
#uname -s
CYGWIN_NT-5.0
#cd /cygdrive/c/users/php/SAPI/
#ls -l php4apache.dll
-rwxr-xr-x 1 ashah None 24576 Dec 30 13:27 php4apache.dll*
so, i'm pretty sure that the file IS there (c:
-- A
// ...httpd.conf
LoadModule php4_module "c:/php/sapi/php4apache.dll"
// ...after restarting apache
Syntax error on line 803 of c:/program files/apache group/apache/conf/httpd.conf
:
Cannot load c:/php/sapi/php4apache.dll into server: (126) The specified module c
ould not be found:
also, i couldn't find any "err.log".
thanks,
-- A
mithril
01-12-2002, 11:25 PM
OK, we're going to assume that you've installed Apache into c:\apache and extracted the PHP zip into c:\php for the sake of this example... modify to fit your actual paths. Follow these steps:
1. Copy php4apache.dll into c:\apache\modules.
2. Copy php4ts.dll into the SYSDIR (c:\windows\system or c:\winnt\system32).
3. Copy all the dll's from the c:\php\dlls folder to the SYSDIR.
4. Copy php.ini into the WINDIR (c:\windows or c:\winnt).
5. Make sure the extension_dir directive in php.ini is set to: "c:\php\extensions"
6. Add the following lines to your httpd.conf:
LoadModule php4_module modules/php4apache.dll
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
7. Restart Apache.
When you restart Apache, do it from the command line if you're on NT, 2K, or XP. The Services applet doesn't give you useful error messages should something fail. Apache should now be quite happily running with PHP as a module.
-geoff
Yeah, i think the shotgun approach will definitely cover all the bases...
but I think I saw a problem in Ankur posted
I previously said watch for the "quotes" but now after looking at my paths, etc....
My install is working as intended now, so ill just give you what I see
I have php4ts.dll in the sysdir as Geoff is saying...but I have php4apache.dll in the /sapi directory same as Ankur.
so i have the line
LoadModule php4_module "C:\program files\apache group\apache\php\sapi\php4apache.dll"
and of course i have the Addtype lines in there, just as Geoff is saying...
I think the problem after looking at it again and again and not seeing it previously is that if you look, Ankur, at your post, you have listed:
**************************
// ...httpd.conf
LoadModule php4_module "c:/php/sapi/php4apache.dll"
// ...after restarting apache
Syntax error on line 803 of c:/program files/apache group/apache/conf/httpd.conf
:
Cannot load c:/php/sapi/php4apache.dll into server: (126) The specified module c
ould not be found:
**************************
It's the Unix vs. Win thing...you have to change your path's backslashes...
Its not that you are copying anything to a wrong directory or that you are "typing" anything incorrectly other than the slashes...
caveat...I hope....
:)
I hope that does it
thanks for your help geoff. I got up to the point where I dont see apache complaining about finding the library anymore, but now I get a windows dialog saying:
"invalid library maybe not a php library (php4apache.dll)"
from searching the archive, I get the feeling that I need to upgrade pdflib(??)
thanks again to you and Richard for your help.
-- A
I have a similar problem. When I use php4apache.dll from an older PHP distribution (i.e. copy over the new one with the old one) Apache doesn't complain at all. Everything goes well, but phpinfo() shows the older version number etc.
When I replace the old php4apache.dll with the new one, Apache complains again at startup. So, it can't be a problem with path, backslashes, quotes, etc. It is a problem with the new php4apache.dll
Any clues?
Sameer
gardner1
02-05-2002, 05:40 PM
have you tried installing Apache 1.3.22 and PHP 4.1.1?
I have found no problems w/ a default install, except those listed above... gotta go to work, but ill check back.
also, make sure you are NOT using a pl(x) version.
those screw up seemingly a bit more than the "stable releases"
Post your versions, OS etc. is this prod, dev, home localhost test?
I have the same problem.
Running Apache 2.0.35 and PHP 4.2.0 in Windows XP, i have the same :
Syntax error on line 948 of C:/Apache2/conf/httpd.conf:
Cannot load C:/Apache2/modules/php4apache.dll into server: The specified module
could not be found.
I have all c:\php\dlls and php4ts.dll copied to c:\windows\system32
and php4apache.dll copied to c:\apache2\modules
I'm pretty sure too, that the configuration files and paths are ok in both, Apache and PHP.
Looks like if there are a problem whith "old" third party modules.
Whith the same configuration and using Apache 1.3.23 instead, all works fine.
Maybe the new 2.0 API of Apache doesn't works at all with the last release of PHP and we need wait a while for the next release to see it working together.
Anyway if someone knows a workaround to this, please post it.
Got the exact same problem. Win XP, Apache 2.0.35, PHP 4.2.0.
Path's and configuration seems (and probably are) okay and the dlls are where they should be (and everywhere else, almost), tried a ****load of things but still get the
'Cannot load E:/php/sapi/php4apache.dll into server: The specified module could not be found.'
*breaks down sobbing* ;)
LoadModule php4_module "e:/php/sapi/php4apache.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Backslash or frontslash makes no difference when it comes to the error.
cantorman
05-20-2002, 06:54 PM
I have PHP 4.2.1 and apache 2.0.36 and also have seen this, in spite of quotes and slashes and making sure things are where they are supposed to be.
The dependency checker that comes with Visual Studio 6 reports that php4apache.dll depends on another dll called apachecore.dll, which didn't come with the php or apache binaries.
My guess is that it comes with the apache source, and indeed there's a reference to apachecore.dll in the source. I was unable to compile it with my meagre compilation skills (parley-vous c++? non, je parle perl)
If this is not a red herring, perhaps some kind soul could fix this dependency.
-d
actually i had the problem also....;
today i opened my eyes....
and saw there was an php4apache2.dll also
and when i load thise module everything goes just fine ;)
Hi,
check this out: http://137.194.8.83/ATSEC/PHP4Apache2Windows.html
Looks like the solution
ciao, Andreas
I have the same problem. I just copied the php4apache.dll in the c:\Apache Group\Apache2\modules and link it in httpd.conf and PHP4 and Apache2 is working fine after restarting apache.
Tested it using the <?phpinfo()?> function.
you have to check also if you *really* made a copy of php4ts.dll to system (or system32) directory under windows. Perhaps you only made a copy of php4ts.lib.
Gabriel.
I've been struggling with this problem for soooo long and it STILL doesn't work. I copied all the files... I made all the changes to the conf file... I did everything that was said in this post. I don't get any errors when I start Apache. The PHP just doesn't work on it! I'm so frusterated. And it's probably just some stupid mistake that I don't see. If anyone can help me out, that would be great.
I think You are close to the solution, but ensure that:
- AddModule mod_php4.c line it's below the others "AddModule" commands.
- The commands:
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
Are into the <IfModule mod_mime.c> block.
Good luck!
Hello!
I had the same problem on Win98 with Apache 2.0.39 and PHP 4.2.1 and used the line
LoadModule php4_module path\php\sapi\php4apache2.dll
and it worked. Thank you!
BlazE
I have been having the problem described earlier in this thread. Using PHP4.2.1 and Apach 2.0.39
I get the message:
C:\Program Files\Apache Group\Apache2>bin\apache
Syntax error on line 173 of C:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
Cannot load C:/Program Files/Apache Group/Apache2/modules/php4apache.dll into se
rver: One of the library files needed to run this application cannot be found.
I just tried using php4apache2.dll and got this error:
C:\Program Files\Apache Group\Apache2>bin\apache
APACHE.EXE: module "c:\php4build\snap\sapi\apache2filter\sapi_apache2.c" is not
compatible with this version of Apache.
Please contact the vendor for the correct version.
The two .dlls are sitting in the modules directory, so I don't think it is a path thing.
I found the problem, The php4apace2.dll in the archive that I was using was not compatible with the latest builds of Apache. I found and downloaded a new version and all is sweet.
heri-setyono
07-07-2002, 04:06 PM
Copy php4apache.dll file into directory where php.exe file is start from and load it's module from httpd.conf. I have tried and successfull.
Three days straight of picking through every support forum I could get my hands on and THIS is the SINGLE POST that made PHP work on my XP/Apache server!
Thank you EVER SO MUCH for your GENIUS assistance!!!
I've tried everything in this thread and it's still not working, but I got a different error emssage after fiddling with it for a bit
also, http://137.194.8.83/ATSEC/PHP4Apache2Windows.html seems to be down .. anyone have a copy??
now I'm getting:
Syntax error on line 126 of c:/program files/apache 2.0/apache2/conf/httpd.conf:
cannot load c:/php/sapi/php4apache2.dll into server: the specified procedure could not be found
firmolari
07-14-2002, 01:43 PM
What new version do you refer to? Apache or PHP.
Which version did you use to work properly, and where do you downloaded?
Thank.
Firmo.
I admit - it works.
It looks like php4apache.dll and php4ts.dll have to be together in the same directory.
Heri Setyono wrote:
-------------------------------
Copy php4apache.dll file into directory where php.exe file is start from and load it's module from httpd.conf. I have tried and successfull.
It's not the path, it's the seperator for them!
ALl the instructions have them in DOS format - ie:
c:\php\sapi\php4apache2.dll
That will not work, change the sep to the Unix style:
c:/php/sapi/php4apache2.dll
Please change the docs to reflect this, or even better, take a large bat to the Apache team member for forcing the issue.
Andrew
hmm, although reading 1k posts from ppl with the same problem:
i ve got win2k/apache2.0.36/php4.2.2
it wont work. he can't find the php4apache.dll - and it doenst matter which seperators i take, or in which dir the dll is... i tried 1k combinations.
plz hlp anyone
thx
bjorn.lindberg
11-28-2006, 11:40 AM
Hello all, thanks for all the helpful input. I solved this problem today using a systrace tool called Process Monitor (http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/processmonitor.mspx) to see what actually went wrong. It goes something like this, apache tries to load some module X (in my case php4apache2.dll) which have dependencies to some other dlls, say Y.dll, and Z.dll, which in turn may have other dependiencies. If for instance Z.dll is missing then apache can't load the module, and then you get the error. I don't know why Apache is so not-verbose with its' error reporting, maybe it could say "cannot not load Z.dll", or maybe it can't given that windows do not provide that information. Eitherway, if you are stuck try the process monitor tool to fiure out exactly what dll that failed to load.
/Björn
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.