logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Trouble getting PHP to work as a module
Author
aa1407



Joined: 04 May 2015
Posts: 4
Location: Chester, UK

PostPosted: Mon 04 May '15 20:37    Post subject: Trouble getting PHP to work as a module Reply with quote

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: 1248
Location: Amsterdam, NL, EU

PostPosted: Tue 05 May '15 0:44    Post subject: Reply with quote

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

PostPosted: Tue 05 May '15 20:55    Post subject: Reply with quote

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 07 May '15 17:50    Post subject: Reply with quote

Apache Apache3.4 does not exist Wink

You might use httpd -V to get the version.
Back to top
aa1407



Joined: 04 May 2015
Posts: 4
Location: Chester, UK

PostPosted: Fri 15 May '15 17:14    Post subject: Reply with quote

Sorry, this was a typo, my version is Apache 2.4
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 19 May '15 17:55    Post subject: Reply with quote

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

PostPosted: Sat 30 May '15 14:44    Post subject: Reply with quote

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Sat 30 May '15 20:16    Post subject: Reply with quote

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


Reply to topic   Topic: Trouble getting PHP to work as a module View previous topic :: View next topic
Post new topic   Forum Index -> Other Software