Discussion:
[PHP-INSTALL] Apache not finding PHP Module
Jonny Dahm
2010-04-06 05:41:45 UTC
Permalink
Hello! I've been working with HTML and PHP for a few weeks now. For
the times leading up to now, I've been working at home on my Windows 7
computer and IIS. I had PHP up and running on my laptop perfectly
fine, but I wanted to work with PHP at school, too. I decided the
best way to do that is have the server on my flashdrive, and that
Apache was the best choice. I got it working and portable (amazingly),
but when I attempted to add a PHP handler, it wouldn't run. This is
the error message I get:

httpd.exe: Syntax error on line 500 of F:/Apache/conf/httpd.conf:
Cannot load F:/Apache/PHP/php5apache2_2.dll into server: The specified
module could not be found.

This is exactly what I added to httpd.conf:
# PHP 5
Loadfile "PHP/php5.dll"

# Load the module
LoadModule php5_module "PHP/php5apache2_2.dll"

# configure the path to php.ini
PHPIniDir "PHP/"

AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

What I've done so far:
1) I made sure that php5apache2_2.dll is in the place I said it was. I
don't know if this makes a difference, but I downloaded the V6 Non-
Thread Safe version of PHP which didn't have that file, so I copied it
from the Thread Safe version (along with some other similar files).
2) I looked at the user feedback and tried some of that stuff out, but
Id like to keep PHP as a handler (I know it's possible).
3) I made sure that the line the error was referring to was in fact
this line:
LoadModule php5_module "PHP/php5apache2_2.dll"
4) I took note of the fact that application/x-httpd-php .php and
application/x-httpd-php-source .phps were missing from mime.types, but
my mentor (who was helping me at the time) told me that was irrelevant
at the moment, so I didn't bother with it yet.

Is there anything I'm missing? It seems I do that sometimes, then
can't for the life of me figure out what's wrong.
Keith Roberts
2010-04-07 05:10:07 UTC
Permalink
Hi Jonny.

Do you need to quote the full path to the apache PHP module?

HTH

Keith

-----------------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
Subject: [PHP-INSTALL] Apache not finding PHP Module
Hello! I've been working with HTML and PHP for a few weeks now. For the
times leading up to now, I've been working at home on my Windows 7 computer
and IIS. I had PHP up and running on my laptop perfectly fine, but I wanted
to work with PHP at school, too. I decided the best way to do that is have
the server on my flashdrive, and that Apache was the best choice. I got it
working and portable (amazingly), but when I attempted to add a PHP handler,
httpd.exe: Syntax error on line 500 of F:/Apache/conf/httpd.conf: Cannot load
F:/Apache/PHP/php5apache2_2.dll into server: The specified module could not
be found.
# PHP 5
Loadfile "PHP/php5.dll"
# Load the module
LoadModule php5_module "PHP/php5apache2_2.dll"
# configure the path to php.ini
PHPIniDir "PHP/"
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
1) I made sure that php5apache2_2.dll is in the place I said it was. I don't
know if this makes a difference, but I downloaded the V6 Non-Thread Safe
version of PHP which didn't have that file, so I copied it from the Thread
Safe version (along with some other similar files).
2) I looked at the user feedback and tried some of that stuff out, but Id
like to keep PHP as a handler (I know it's possible).
3) I made sure that the line the error was referring to was in fact this
LoadModule php5_module "PHP/php5apache2_2.dll"
4) I took note of the fact that application/x-httpd-php .php and
application/x-httpd-php-source .phps were missing from mime.types, but my
mentor (who was helping me at the time) told me that was irrelevant at the
moment, so I didn't bother with it yet.
Is there anything I'm missing? It seems I do that sometimes, then can't for
the life of me figure out what's wrong.
Lester Caine
2010-04-07 06:45:26 UTC
Permalink
Hello! I've been working with HTML and PHP for a few weeks now. For the
times leading up to now, I've been working at home on my Windows 7
computer and IIS. I had PHP up and running on my laptop perfectly fine,
but I wanted to work with PHP at school, too. I decided the best way to
do that is have the server on my flashdrive, and that Apache was the
best choice. I got it working and portable (amazingly), but when I
attempted to add a PHP handler, it wouldn't run. This is the error
httpd.exe: Syntax error on line 500 of F:/Apache/conf/httpd.conf: Cannot
load F:/Apache/PHP/php5apache2_2.dll into server: The specified module
could not be found.
# PHP 5
Loadfile "PHP/php5.dll"
# Load the module
LoadModule php5_module "PHP/php5apache2_2.dll"
# configure the path to php.ini
PHPIniDir "PHP/"
So where IS PHP?
The above settings do assume it is in F:/Apache/PHP, but obviously it is
somewhere else - and I would guess F:/PHP if all you have done is installed
using the defaults. So just need the F:/ adding ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
b***@aol.com
2010-04-07 22:10:27 UTC
Permalink
This is the full path to the PHP module (assuming that the flash drive is
read as the F:/ drive):
F:/Apache/PHP/
I manually installed PHP in this directory. I'm going to reinstall PHP
again, just to make sure I did everything right.
This is what I am downloading:
PHP 5.3 (5.3.2)
VC6 x86 Non Thread Safe (2010-Mar-04 20:11:06)
found at:
<http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC6-x86.zip>

I am extracting it to F:/Apache/PHP/

--------------------------------------------------
From: "Lester Caine" <***@lsces.co.uk>
Sent: Wednesday, April 07, 2010 1:45 AM
To: <php-***@lists.php.net>
Subject: Re: [PHP-INSTALL] Apache not finding PHP Module
Post by Lester Caine
Hello! I've been working with HTML and PHP for a few weeks now. For the
times leading up to now, I've been working at home on my Windows 7
computer and IIS. I had PHP up and running on my laptop perfectly fine,
but I wanted to work with PHP at school, too. I decided the best way to
do that is have the server on my flashdrive, and that Apache was the
best choice. I got it working and portable (amazingly), but when I
attempted to add a PHP handler, it wouldn't run. This is the error
httpd.exe: Syntax error on line 500 of F:/Apache/conf/httpd.conf: Cannot
load F:/Apache/PHP/php5apache2_2.dll into server: The specified module
could not be found.
# PHP 5
Loadfile "PHP/php5.dll"
# Load the module
LoadModule php5_module "PHP/php5apache2_2.dll"
# configure the path to php.ini
PHPIniDir "PHP/"
So where IS PHP?
The above settings do assume it is in F:/Apache/PHP, but obviously it is
somewhere else - and I would guess F:/PHP if all you have done is
installed using the defaults. So just need the F:/ adding ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
b***@aol.com
2010-04-07 23:23:16 UTC
Permalink
OH! As it turns out, I looked at the manual install instructions more
carefully and discovered that php5apache2_2.dll is not included in the
non-thread-safe version, so instead of downloading
VC6x86 Non Thread Safe
I downloaded
VC6x86 Thread Safe

It compiles correctly now. Apparently you can't just copy and paste
php5apache2_2.dll from the Thread Safe version into your Non Thread Safe
version and expect it to work. It also appears that Apache 2.2.x does not
like the Non Thread Safe version of PHP 5.3. Go figure.

So, in conclusion, this is what works for me:
Install the V6 THREAD SAFE version of PHP 5.3
add the following in the specified locations of httpd.conf, replacing
%phpdir% with the directory to your installation of PHP:

#At the end of the LoadModule section----
Loadfile %phpdir%/php5ts.dll
LoadModule php5_module %phpdir%/php5apache2_2.dll
PHPIniDir %phpdir%

#Inside the <IfModule mod_mime.c>----
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

#At the end of the file:
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps

#If you want the handler to only handle files that END in .php, add this to
the end:
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

I suppose that it might work if you appended all of this (in the order they
appear in the list) to the end of the file, it might work as well, but it
works for me now and I'm not going to mess it up. I apologize for cluttering
the mailing-list, if you consider this clutter.

--------------------------------------------------
From: <***@aol.com>
Sent: Wednesday, April 07, 2010 5:10 PM
To: "Lester Caine" <***@lsces.co.uk>; <php-***@lists.php.net>
Subject: Re: [PHP-INSTALL] Apache not finding PHP Module
Post by b***@aol.com
This is the full path to the PHP module (assuming that the flash drive is
F:/Apache/PHP/
I manually installed PHP in this directory. I'm going to reinstall PHP
again, just to make sure I did everything right.
PHP 5.3 (5.3.2)
VC6 x86 Non Thread Safe (2010-Mar-04 20:11:06)
<http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC6-x86.zip>
I am extracting it to F:/Apache/PHP/
--------------------------------------------------
Sent: Wednesday, April 07, 2010 1:45 AM
Subject: Re: [PHP-INSTALL] Apache not finding PHP Module
Post by Lester Caine
Hello! I've been working with HTML and PHP for a few weeks now. For the
times leading up to now, I've been working at home on my Windows 7
computer and IIS. I had PHP up and running on my laptop perfectly fine,
but I wanted to work with PHP at school, too. I decided the best way to
do that is have the server on my flashdrive, and that Apache was the
best choice. I got it working and portable (amazingly), but when I
attempted to add a PHP handler, it wouldn't run. This is the error
httpd.exe: Syntax error on line 500 of F:/Apache/conf/httpd.conf: Cannot
load F:/Apache/PHP/php5apache2_2.dll into server: The specified module
could not be found.
# PHP 5
Loadfile "PHP/php5.dll"
# Load the module
LoadModule php5_module "PHP/php5apache2_2.dll"
# configure the path to php.ini
PHPIniDir "PHP/"
So where IS PHP?
The above settings do assume it is in F:/Apache/PHP, but obviously it is
somewhere else - and I would guess F:/PHP if all you have done is
installed using the defaults. So just need the F:/ adding ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Keith Roberts
2010-04-08 05:21:41 UTC
Permalink
No it's a valid problem and it's not clutter. Someone else
might have a similar problem like this, and find the answer
here.

Thans for taking the time to post the solution to your
problem.

Kind Regards,

Keith

-----------------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
Post by b***@aol.com
Subject: Re: [PHP-INSTALL] Apache not finding PHP Module
OH! As it turns out, I looked at the manual install instructions more
carefully and discovered that php5apache2_2.dll is not included in the
non-thread-safe version, so instead of downloading
VC6x86 Non Thread Safe
I downloaded
VC6x86 Thread Safe
It compiles correctly now. Apparently you can't just copy and paste
php5apache2_2.dll from the Thread Safe version into your Non Thread Safe
version and expect it to work. It also appears that Apache 2.2.x does not
like the Non Thread Safe version of PHP 5.3. Go figure.
Install the V6 THREAD SAFE version of PHP 5.3
add the following in the specified locations of httpd.conf, replacing
#At the end of the LoadModule section----
Loadfile %phpdir%/php5ts.dll
LoadModule php5_module %phpdir%/php5apache2_2.dll
PHPIniDir %phpdir%
#Inside the <IfModule mod_mime.c>----
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
#If you want the handler to only handle files that END in .php, add this to
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
I suppose that it might work if you appended all of this (in the order they
appear in the list) to the end of the file, it might work as well, but it
works for me now and I'm not going to mess it up. I apologize for cluttering
the mailing-list, if you consider this clutter.
--------------------------------------------------
Sent: Wednesday, April 07, 2010 5:10 PM
Subject: Re: [PHP-INSTALL] Apache not finding PHP Module
Post by b***@aol.com
This is the full path to the PHP module (assuming that the flash drive is
F:/Apache/PHP/
I manually installed PHP in this directory. I'm going to reinstall PHP
again, just to make sure I did everything right.
PHP 5.3 (5.3.2)
VC6 x86 Non Thread Safe (2010-Mar-04 20:11:06)
<http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC6-x86.zip>
I am extracting it to F:/Apache/PHP/
--------------------------------------------------
Sent: Wednesday, April 07, 2010 1:45 AM
Subject: Re: [PHP-INSTALL] Apache not finding PHP Module
Post by Lester Caine
Hello! I've been working with HTML and PHP for a few weeks now. For the
times leading up to now, I've been working at home on my Windows 7
computer and IIS. I had PHP up and running on my laptop perfectly fine,
but I wanted to work with PHP at school, too. I decided the best way to
do that is have the server on my flashdrive, and that Apache was the
best choice. I got it working and portable (amazingly), but when I
attempted to add a PHP handler, it wouldn't run. This is the error
httpd.exe: Syntax error on line 500 of F:/Apache/conf/httpd.conf: Cannot
load F:/Apache/PHP/php5apache2_2.dll into server: The specified module
could not be found.
# PHP 5
Loadfile "PHP/php5.dll"
# Load the module
LoadModule php5_module "PHP/php5apache2_2.dll"
# configure the path to php.ini
PHPIniDir "PHP/"
So where IS PHP?
The above settings do assume it is in F:/Apache/PHP, but obviously it is
somewhere else - and I would guess F:/PHP if all you have done is
installed using the defaults. So just need the F:/ adding ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Loading...