Using PHP 7 with WAMP

24,670

Solution 1

There is the answer :

I was running with the last official wampserver which seems to be not compatible with php7 (I have made some tests on 4 computers with the same result of my problem).

One of my colleague give me this link: http://forum.wampserver.com/read.php?1,126455 with some tutorials to update wampserver to unofficial new versions. Following this indications I have updated folders wamp/scripts and wamp/lang. After that apache start normally using php 7.

PS : it seems to be some errors with certain php functions. One more fix is to update some other wampserver files, the details are on the link up. But for the moment I haven't got this errors.

Thank you to all the people who are coming on this page and giving me some help.

I hope in the future some other developers will found answers here.

Solution 2

On windows, click on wamp php, versions,then select your version enter image description here

Solution 3

I found out the trick for the Version 3.0 + LEFT click (instead right click) to the Wamp icon tray e choose the PHP Version.

Solution 4

I just fix the same error earlier. All links are from the french wampserver forum, maybe the same links can be find in english.

First, follow all steps that are discribed here (otomatic's response, it works fine for me with the php7.0.0 release) : http://forum.wampserver.com/read.php?1,133587,133587#msg-133618

care about to update your wampserver version following these steps : (if you don't run a 3.0 wampserver ) http://forum.wampserver.com/read.php?1,126455

Don't forget to install all packages at step 20 (both x86 and x64) in the wampserver forum's CONSEILS DE DEPANNAGE section: forum.wampserver.com/read.php?1,88043

After that, some symbolic's links can be missing with a php7 dll. So, you have to add some lines in wamp/scripts/config.inc.php (view otomatic's #msg-135093 in the first link) : forum.wampserver.com/read.php?1,133587,133587#msg-133618

I hope that could help you.

Share:
24,670
tyd01
Author by

tyd01

Updated on August 05, 2022

Comments

  • tyd01
    tyd01 over 1 year

    My OS is Windows 10 Pro x64 and I have installed VC14 packages x86 and x64.

    I have added a php7.0.0 directory to wamp/bin/php, copied files php.ini, phpForApache.ini and wampserver.conf, and modified the directories and php extensions in these files.

    There is my wampserver.conf:

    <?php
    $phpConf['phpIniDir'] = '.';
    $phpConf['phpExeDir'] = '.';
    $phpConf['phpConfFile'] = 'php.ini';
    
    //PHP 7 needs Apache 2.4.x and doesn't works with Apache 2.2.x
    $phpConf['apache']['2.4']['LoadModuleName'] = 'php7_module';
    $phpConf['apache']['2.4']['LoadModuleFile'] = 'php7apache2_4.dll';
    $phpConf['apache']['2.4']['AddModule'] = '';
    ?>
    

    It is correctly read by WAMP because when I select the php7.0.0 version, the Apache httpd.conf gets this line:

    LoadModule php7_module "c:/wamp/bin/php/php7.0.0/php7apache2_4.dll"
    

    The path is correct and the dll file exists, but the Apache service doesn't start and if I check Apache extensions, the php7_module is indicated as not found (red square).

    If I check apache error log, the only reported one is

    [Tue Dec 08 11:02:14.021018 2015] [core:warn] [pid 5008:tid 516] AH00098: pid file C:/wamp/bin/apache/apache2.4.9/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

    Does anyone who has successfully run PHP 7 in WAMP server know a fix for this problem? Thank you.

  • Alexander
    Alexander about 6 years
    Version 3? Is this really related? People are talking about PHP7 here...
  • novecentonove
    novecentonove about 6 years
    I thought it was obvious I meant WAMP version 3. Regards.