Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LoadModule php4_module error

Status
Not open for further replies.

JESTAR

Programmer
Feb 13, 2002
213
GB
I'm trying to set up Apache to recognise PHP. I'm not on Apache2, the one before that 1.3 or something, and PHP4.

It's telling me:

In order for Apache to recognize a PHP file as one that needs to be parsed with the PHP engine, you need to add the following two lines to your httpd.conf file:

AddType application/x-httpd-php .php3 .php
AddType application/x-httpd-php-source .phps

... now add the PHP module into your httpd.conf program so Apache can properly parse PHP.

In your program, add the following line:

LoadModule php4_module c:/php/sapi/php4apache2.dll

Right now when I run Apache, it brings up a syntax error on that line and says it can't locate that file. I've tried changing it to php4apache.dll and it still comes up like this. The book also says "Note that it uses forwardslashes, not backslashes"

Anyone know what's wrong here?

I found this:

... saying that the problem comes from downloading the installer of Apache, not the Zip file, but I did download and install from the zip, not the installer.

I've also run through this:

and it still doesn't work.

Windows XP btw.
 
I'd suggest you run a file-find on your system and locate where your copy of the php4apache2.dll file actually is. Then specify that path.
 
I've tried this, it is in c:\php\sapi\php4apache2.dll
 
Try putting the file name in quotes? I'm just being paranoid now, as there are no characters in that path that require quoting.
 
I am not sure if this is exactly the same problem but I just started a fresh installation of Apache 1.3.33 with PHP 4.3.10 and after adding the

LoadModule php4_module D:/apm/php/sapi/php4apache.dll

the Apache server would not start with two error entries in the EventLog: one saying that my syntax on the LoadModule line in httpd.conf is wrong and the second one saying it could not load the module specified on that line.

Since I remembered reading something about php4ts.dll file being required by php4apache.dll I tried to simply copy it (alongside with php4ts.lib file) from the PHP installation root directory to the sapi dir where the php4apache.dll lives. From that point on the Apache server would start OK.

I assume that the proper way would be in adding my PHP path to the environment variables (which I am going to do anyway) but for the time being this solved my problem. So if it solves someone else's too :) I'll be happy with it.

ToM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top