Author |
|
MegamanXGold
Joined: 17 Jul 2006 Posts: 2
|
Posted: Mon 17 Jul '06 2:32 Post subject: PHP module not found |
|
|
Since this is a software problem I won't bother with posting the hardware.
This is for a personal web server.
I have had some experience with Apache2, PHP4, and MySQL. With servers running stable (scary enough) on a Windows 98 Environment (phpBB and low-pop visits to the rest of the site) and later in Windows 2000 (when higher pop). Just so there's some background experience here. It's been nearly 3 years since, however, that I've had a running web server.
The software today:
Windows XP Professional SP2
Apache 2.2.2
PHP 5.0.22
MySQL5
phpBB3 (soon)
If I have problems I don't mind starting over and trying something different. But right now the problem is that Apache2 can't find the module for PHP.
I have PHP5 in my C:\php\ directory, and my php5apache2.dll file in that folder. In the install.txt file that came with the PHP5 distribution, it says to put these lines in the httpd.conf file:
Code: | LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php" |
I do that, and sure enough, Apache2 reports this:
apache2.2.2 Test Configuration wrote: | httpd.exe: Syntax error on line 121 of C:/Apache/conf/httpd.conf: Cannot load C:/php/php5apache2.dll into server: The specified module could not be found. |
I've tried changing it to these and no improvements occurred:
Code: | LoadModule php5_module c:/php/php5apache2.dll
LoadModule php5_module "c:\php\php5apache2.dll"
LoadModule php5_module C:/php/php5apache2.dll
LoadModule php5_module "C:\php\php5apache2.dll" |
I've even tried copying the entire php folder into my Apache root, and using ./php/php5apache2.dll and that didn't help. And I tried copying the php5apache2.dll into my modules folder and using modules/php5apache2.dll and that improved nothing either.
The lib file and the php5apache2.dll were the most up to date "Connector" files I could get, I think they came from the MySQL5 page. If that makes a difference then I can redownload the .zip and replace the files I suppose, but I don't see why it should prevent a module from being "found".
Setting up a web server is very important to me right now, this will be my first time in 3 years I've had the self motivation to make websites again, have it been my hobbie the previous 4 and half years. And I want to make a very special website for a very special girl...so any and all help is more than appreciated.
Thank you all very much for any support suggestions you may have, another note, this is all a fresh install. |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Mon 17 Jul '06 3:09 Post subject: |
|
|
IF YOU INSTALLED APACHE USING MSI FILE THEN (otherwise skip down to CONTINUE section):
I have not tested ASF MSI installation applications lately, but the last time I tested the MSI FAILED to remove to some things that can cause problems later on. BEFORE you UN-INSTALL the MSI file, open a command prompt and navigate to the BIN folder of Apache. Now, uninstall the service:
httpd -k uninstall
Now that the service is removed, uninstall Apache and remove ALL PHP entries (files that you copied from where ever to where ever).
CONTINUE:
Install VC++ Redistributable. It can be downloaded at the link below:
http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
Download Apache 2.2.x from http://www.apachelounge.com/download/
Unzip his ZIP file in a new folder called something like C:\Apache2. Then, read the file named Read Me First !!.txt. It will tell you how to setup the service for Apache. If you want or need ApacheMonitor you can create shortcuts however you like. Before installing ANYTHING else, ensure Apache will start. After you validate that Apache starts, stop it before proceding.
If you are still with me, now download PHP 5.1.4 from PHP.net you want this file: php-5.1.4-Win32.zip
Extract the contents of this file and move the contents to where you intend to use PHP such as C:\PHP5. Overwrite the php5apache2.dll with Steffen's version:
Downloal php5apache2.dll from www.apachelounge.com/download/
Add the folder that you put the PHP files into in the PATH ENVIRONMENT (System Properties | Advanced | Environment Variables | System variables | Path). Example:
Variable name: Path
Variable value: C:\php5;%SystemRoot%\system32;.....
DO NOT WORRY with coping files over to the Windows folders, the reason for this to begin with is because Windows folder is already in the Path. Since you have added the PHP folder to the Path you do not need to copy or move files to the Windows folder. This will make upgrading PHP simpler as well and allows you to keep PHP all together.
Finally, this should be the last step, edit the Apache CONF file with:
LoadModule php5_module "c:/php5/php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php-source .phps
# configure the path to php.ini
PHPIniDir "c:/php5"
This is how I put together WAMP, and I do it often (web application tester). I hoped this helped.
Let us know how it works out.
..
. |
|
Back to top |
|
MegamanXGold
Joined: 17 Jul 2006 Posts: 2
|
Posted: Mon 17 Jul '06 17:09 Post subject: |
|
|
Thank you very much for all the work you put into your post! The web server is now correctly accepting PHP5. I tested it with one of my old PHP enabled sites, and with exception to I think an array and a cookie setting button I made, it worked like it used to.
So now all I gotta do is learn the changes in PHP over the last 3 years. ^.^ lol.
Thank you again SO much. Have an awsome day! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 17 Jul '06 17:28 Post subject: |
|
|
MegamanXGold wrote: |
So now all I gotta do is learn the changes in PHP over the last 3 years. ^.^ lol.
|
So you worked with 4.3.4
Released: 03 November 2003
That is very old!
5.0.0
Released: 13 July 2004 so it is nearly exact 2 years old. Why do so many ppl still use version 4? I'm waiting for Version 6 with unicode |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Mon 17 Jul '06 17:51 Post subject: |
|
|
Mega,
Good hearing you have it going. If you were able to handle PHP 4.x, PHP5.x has much of the same but has quite of few new features mainly related to making PHP more objected oriented (more aptly 'object based').
James,
A agree, why use PHP 4 when PHP 5 is fairly well proven. The only thing that would make sense to me - Many hosts only offer PHP 4, and people want to replicate what their host servers have. Other than that, I still scratch my head. |
|
Back to top |
|
neetals
Joined: 27 Jun 2007 Posts: 1 Location: Vadodara - INDIA
|
Posted: Wed 27 Jun '07 16:32 Post subject: |
|
|
dear pnllan
I tried your way of installation and it did got installed but now its giving an problem. Every time i execute a .php file its giving me error that Apache has encounter some problem and it should shutdown.
The technical error was in following files:
C:\DOCUME~1\nks\LOCALS~1\Temp\WER07ca.dir00\httpd.exe.mdmp
C:\DOCUME~1\nks\LOCALS~1\Temp\WER07ca.dir00\appcompat.txt
can you guide me whats the problem??? till now i have never faced such problem.
Regards
Neetal Shah |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
natere2ster
Joined: 05 Dec 2010 Posts: 1 Location: Atlanta, Ga
|
Posted: Sun 05 Dec '10 20:18 Post subject: not working |
|
|
any other ideas?
I get an error
httpd.exe: Syntax error on line 129 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/php5/php5apache2.dll into server: The specified module could not be found.
I checked and its sitting right therein my directory:
LoadModule php5_module "C:/php5/php5apache2.dll"
its in there...but cannot be found? used to be so simple to setup not sure what they broke LOL
i guess back to my os x boxxx
|
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sun 05 Dec '10 23:11 Post subject: |
|
|
pretty simple
php5apache.dll -> Apache 1.3
php5apache2.dll -> Apache 2.0
php5apache2_2.dll -> Apache 2.2
If you are running 2.2.? then you need to be using the 2_2 dll |
|
Back to top |
|
mowji
Joined: 07 Jul 2011 Posts: 4
|
Posted: Thu 07 Jul '11 17:09 Post subject: |
|
|
I am using (on MSWindows7,64,pro) Apache httpd 2.2.19 with PHP 5.2.17 and still get the same error:
">>> httpd.exe: Syntax error on line 132 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/tmp/php5apache2_2.dll into server: The specified module could not be found. ."
(There appear to be some extra spaces and "." at end of the error message.)
I have tried to relocate this dll file to different locations, checked directory permissions, but still get the same error. My httpd.conf has the following lines:
LoadModule php5_module "c:/tmp/php5apache2_2.dll"
<Directory "C:/tmp">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
#PHPIniDir "C:/Program Files (x86)/PHP/PHP5.2.17"
And, inside <IfModule mime_module>, the following line
AddType application/x-httpd-php .php
If I remove the php things, Apache webserver runs just fine.
I have tried downloading this php dll from several different places, all with same results. Somewhere I read that this has been linked with wrong Apache libraries - and I get similar kinds of error when I run pgp.exe on php_pgsql.dll - but I am not sure what to do about it.
I will appreciate any help in getting this resolved.
Thanks a lot
dinesh |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 07 Jul '11 20:49 Post subject: |
|
|
Hey mowji,
where did you download your apache? Apache.org or apachelounge or somewhere else? Do you use vc6 or vc9 version of php? |
|
Back to top |
|
mowji
Joined: 07 Jul 2011 Posts: 4
|
Posted: Fri 08 Jul '11 3:05 Post subject: |
|
|
Hi James,
PHP -- I took V6/thread-safe version, because there was a warning label on V9/5.3 for users of Apache binaries.
Apache -- IIRC I took it from apache.org. I used the MSI installer package.
Regards
Dinesh |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 08 Jul '11 10:29 Post subject: |
|
|
OK now I think I get it.
Is your installation located in C:/Program Files (x86)/PHP/PHP5.2.17 ??
Than why did you put php5apache2_2.dll into C:\tmp ? |
|
Back to top |
|
mowji
Joined: 07 Jul 2011 Posts: 4
|
Posted: Fri 08 Jul '11 14:53 Post subject: |
|
|
I originally had the dll in C:\Program Files (x86)\PHP\PHP5.2.17 but same results. I wasn't sure if the embedded space in the directory name was causing the error, and therefore moved it to c:\tmp. It did not make any difference. I tried variously with single quotes, and escaping the backslashes - all to same result.
Is this a syntax issue at httpd.conf level, or is it something inside the DLL itself?
Regards
Dinesh |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 08 Jul '11 19:08 Post subject: |
|
|
With the long path and all the php files in it, did you use quotes (") around the path? The php5apache2_2.dll needs all the files in in php directory and apache often can't handle a path with white space in it as it is in C:\Program Files (x86) |
|
Back to top |
|
mowji
Joined: 07 Jul 2011 Posts: 4
|
Posted: Fri 08 Jul '11 20:37 Post subject: |
|
|
Hi James,
Yes I used quotes around the module with long path name and embedded space characters.
I am also using an conf directive like --
ServerRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2"
which seems to handle spaces and long directory names quite gracefully. It is also the choice made by the installer by default.
Nonetheless, based on your replies I resinstalled the PHP stuff in a brand new directory named C:\PHP\PHP5.2.17 (no spaces) and edited the httpd.conf to use the new directory name. Darn!
The error message posted by httpd is very clearly misleading - the module is very tangibly present. I wish the developers would also think of the consumer of these error messages.
Thanks a lot taking the time to look into my problem. May be this is way more complicated than you and I imagined.
Regards.
Dinesh |
|
Back to top |
|
BlueSwan
Joined: 08 Jul 2011 Posts: 2
|
Posted: Fri 08 Jul '11 22:04 Post subject: |
|
|
I have a similar sort of problem. I get the same basic error message. I just downloaded the latest httpd-2.2.19-win32-x86-ssl from Apache Lounge today and followed the instructions here: http://www.apachelounge.com/viewtopic.php?t=2394 and got Apache up and running. So far so good. The problems came when trying to install PHP 5.3.6. (php-5.3.6-nts-Win32-VC9-x86). I think the problems could stem from this part of the instruction:
"THIS MUST BE ACCOMPLISHED (see note below): Add the folder that you put the PHP files into in the PATH ENVIRONMENT (System Properties | Advanced | Environment Variables | System variables | Path).
Example:
Variable name: Path
Variable value: C:\php5;%SystemRoot%\system32;....."
The reason why I think that, is because I quite frankly don't understand that part of the instruction. It says "example". But I literally wrote EXACTLY that. The string "C:\php5;%SystemRoot%\system32;....." looks odd to me. However, I had no clue what to enter if not exactly that.
I'm installing on Win 7. Installed apache in c:\apache2 and PHP in c:\PHP5.
Also I appear to not have any file entitled anything with "apache" in it in my PHP folder. Not a PHPapache2.2.dll or anytning resembling that.
What to do?? I'm am admittedly a bit of a noob, but generally not a complete moron. |
|
Back to top |
|
BlueSwan
Joined: 08 Jul 2011 Posts: 2
|
Posted: Sat 09 Jul '11 13:23 Post subject: |
|
|
BlueSwan wrote: | I have a similar sort of problem. I get the same basic error message. I just downloaded the latest httpd-2.2.19-win32-x86-ssl from Apache Lounge today and followed the instructions here: http://www.apachelounge.com/viewtopic.php?t=2394 and got Apache up and running. So far so good. The problems came when trying to install PHP 5.3.6. (php-5.3.6-nts-Win32-VC9-x86). I think the problems could stem from this part of the instruction:
"THIS MUST BE ACCOMPLISHED (see note below): Add the folder that you put the PHP files into in the PATH ENVIRONMENT (System Properties | Advanced | Environment Variables | System variables | Path).
Example:
Variable name: Path
Variable value: C:\php5;%SystemRoot%\system32;....."
The reason why I think that, is because I quite frankly don't understand that part of the instruction. It says "example". But I literally wrote EXACTLY that. The string "C:\php5;%SystemRoot%\system32;....." looks odd to me. However, I had no clue what to enter if not exactly that.
I'm installing on Win 7. Installed apache in c:\apache2 and PHP in c:\PHP5.
Also I appear to not have any file entitled anything with "apache" in it in my PHP folder. Not a PHPapache2.2.dll or anytning resembling that.
What to do?? I'm am admittedly a bit of a noob, but generally not a complete moron. |
Never mind, I figured it out. I just had to download the "thread safe" version of PHP instead of the "non thread safe" version.
I'm sure I'll have more problems soon though. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sun 10 Jul '11 12:29 Post subject: |
|
|
mowji wrote: |
Nonetheless, based on your replies I resinstalled the PHP stuff in a brand new directory named C:\PHP\PHP5.2.17 (no spaces) and edited the httpd.conf to use the new directory name. Darn!
|
Does it work now?
mowji wrote: |
The error message posted by httpd is very clearly misleading - the module is very tangibly present. I wish the developers would also think of the consumer of these error messages.
|
Well most apache dev live in a linux / unix world. There things work differently |
|
Back to top |
|