Search code examples
phpwampserver

Wampserver gibin not a valid Win32 application with php 5.4


I replaced my 2.1 version of WampServer with the 3.1.4 64 bit version. Everything worked after the installation. But I need to have php 5.4 and that doesn't come with this version of WS. So I downloaded that version, made the changes to the various files as mentioned here and other places. But when I switch to 5.4 it doesn't start.

I ran the "Check State of Services" tool and it said this

State of services:

The service 'wampapache64' is NOT started EXIT error code:1066 Help message for error code 1066 is: The service has returned a service-specific error code.

The service 'wampmysqld64' is started

The service 'wampmariadb64' is started

The service 'dnscache' is started

WampServer (Apache, PHP and MySQL) will not function properly if any service 'wampapache64' 'wampmysqld64' 'wampmariadb64' 'dnscache' is not started.

And the "Check http.conf" tool said

httpd.exe: Syntax error on line 195 of C:/wamp64/bin/apache/apache2.4.35/conf/ht tpd.conf: Cannot load c:/wamp64/bin/php/php-5.4.9/php5apache2_4.dll into server: %1 is not a valid Win32 application.

And line 195 of that file is

LoadModule php5_module "${INSTALL_DIR}/bin/php/php-5.4.9/php5apache2_4.dll"

Is it failing because the dll file is for the wrong version or do to something else? I've tried to locate a php5apache2_4.dll file for 32 bit but I couldn't find one.

I've spent most of the weekend on this and if I can't get it going I will need to go back to my previous version since I work on more sites using 5.4 than later versions. I hope I don't have to do that.


Solution

  • If you are using WAMPServer 3 or greater then there are a multitude of versions of PHP that can be downloaded as ADDONS. In other words installed into WAMPServer with a simple download and click to install.

    I suggest you remove the manually installed version of PHP and use the provided downloads.

    They are available from SourceForgce, but they are a LOT EASIER to find on the WAMPServer backup repo

    It looks like you may need to use the 32bit WAMPServer 3.1.4 as there does not appear to be a 64bit PHP5.4 available in the ADDON list.

    You may also find that you need to download an older version of Apache to get PHP5.4 to run as Apache and PHP have to be installed to versions that are compatibly compiled.

    But with WAMPServer 3 there are 16 versions of Apache and 50 or so versions of PHP.

    EDIT: In answer to your comment

    If you uninstall the 64bit WAMPServer (after backing up site code and any databases) and install the 32bit WAMPServer V3.1.4.

    The version of Apache i.e. V2.4.35 that comes with WAMPServer3.1.4 will run PHP5.4.45. So once you have WAMPServer 3.1.4 installed and working (check it works before continuing) you can download and install the ADDON for PHP5.4.45

    Then using the wampmanager menu, switch to PHP5.4.45.

    The version of MySQL is not directly link to Apache/PHP so the version that comes with WAMPServer V3.1.4 will work just fine.

    enter image description here

    It would also be a good idea to apply the WAMPServer 3.1.5 upgrade to WAMPServer 3.1.4 so you are totoally upto date with WAMPServer