Author |
|
aa1407
Joined: 04 May 2015 Posts: 4 Location: Chester, UK
|
Posted: Mon 04 May '15 20:37 Post subject: Trouble getting PHP to work as a module |
|
|
Hello,
I have looked and don't think my question has been asked before, apologies if I've missed it, please point me in the right direction.
Here is my problem:
I have Windows7, Apache3.4 and PHP 5.6.8.
I am following these instructions:
http://www.apachelounge.com/viewtopic.php?t=2394
On adding this code:
LoadModule php5_module "c:/php5/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "c:/php5"
in the httpd.conf file (as instructed in above mentioned intructions), I get the following error:
httpd: Syntax error on line 178 of C:/Apache24/conf/httpd.conf: Cannot load c:/p
hp5/php5apache2_4.dll into server: %1 is not a valid Win32 application.
I did check and php5apache2_4.dll is in the relevant folder (though I did have to switch to the thread safe version of php5.6.8 to get it).
I don't know what to do about it! Any help would be most welcome. Many thanks in advance. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Tue 05 May '15 0:44 Post subject: |
|
|
Most probably you are using a x86 dll with the x64 Apache, or the other way around. |
|
Back to top |
|
aa1407
Joined: 04 May 2015 Posts: 4 Location: Chester, UK
|
Posted: Tue 05 May '15 20:55 Post subject: |
|
|
Hi
Thank you very much for pointing this out. I *think* I've changed it to everything being x64. Now when I enter:
httpd -S
in the command line, I get this:
C:\Apache24\bin>httpd -S
VirtualHost configuration:
ServerRoot: "C:/Apache24"
Main DocumentRoot: "C:/Apache24/htdocs"
Main ErrorLog: "C:/Apache24/logs/error.log"
Mutex default: dir="C:/Apache24/logs/" mechanism=default
PidFile: "C:/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Forgive my ignorance, but how does that look to you? Is that all good or is there still something wrong?
In particular, I'm not sure if it wants me to define the dump files or if the last two rows are just normal?
Thanks again! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 07 May '15 17:50 Post subject: |
|
|
Apache Apache3.4 does not exist
You might use httpd -V to get the version. |
|
Back to top |
|
aa1407
Joined: 04 May 2015 Posts: 4 Location: Chester, UK
|
Posted: Fri 15 May '15 17:14 Post subject: |
|
|
Sorry, this was a typo, my version is Apache 2.4 |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 19 May '15 17:55 Post subject: |
|
|
Can you post the full output from httpd -V?
And you might post the link from windows.php.net that you are using. |
|
Back to top |
|
aa1407
Joined: 04 May 2015 Posts: 4 Location: Chester, UK
|
Posted: Sat 30 May '15 14:44 Post subject: |
|
|
Here goes:
C:\Apache24\bin>httpd -V
Server version: Apache/2.4.12 (Win64)
Apache Lounge VC11 Server built: Mar 20
Server's Module Magic Number: 20120211:41
Server loaded: APR 1.5.1, APR-UTIL 1.5.4
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: WinNT
threaded: yes (fixed thread count)
forked: no
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses d
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/apache"
-D SUEXEC_BIN="/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtim
-D DEFAULT_ERRORLOG="logs/error.log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
I *think* I'm now using php-5.6.8-Win32-VC11-x64
So please can you let me know if the below is normal or if I need to do anything about the dumps (maybe define the file or folder?) or about anything else:
C:\Apache24\bin>httpd -S
VirtualHost configuration:
ServerRoot: "C:/Apache24"
Main DocumentRoot: "C:/Apache24/htdocs"
Main ErrorLog: "C:/Apache24/logs/error.log"
Mutex default: dir="C:/Apache24/logs/" mechanism=default
PidFile: "C:/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Many thanks in advance! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 30 May '15 20:16 Post subject: |
|
|
the x64 build of PHP is experimental. However I saw a lot of installations running with that.
The correct php package for you is VC11 x64 Thread Safe.
And yes the output looks correct.
Can you start apache with PHP?
Try to start PHP on the command line to see if you installed the needed run time libs.
Code: |
C:\php5\>php.exe -m
|
|
|
Back to top |
|