WAMP Server errors switching Apache / PHP versions on fresh install - php

A fresh download and install of WAMP Server works successfully (Apache 2.4.4 PHP 5.4.12).
However as soon as I install a different version of Apache, in this case 2.4 to 2.0 (so I can run PHP 5.2 & 5.4), WAMP goes offline with an orange icon.
If I try to switch BACK to the original Apache version I get this show-stopping error:
Sorry,
This Apache version doesn't seem to be compatible with your actual PHP Version.
Switch cancelled.
Press ENTER to continue...
This doesn't make any sense, as this is a fresh install so both the Apache + PHP versions are the defaults.
Here's what the UI is telling me:
The WAMP icon is now orange
the Apache/Version/2.4.4 icon has a red warning icon next to it
the Apache/Version/2.0.63 icon has a tick next to it
I've tried installing other versions of Apache too, but the issue seems to be with the base 2.4 WAMP installed options.
Extra info: port 80 is free, and I used to use WS 2.0e all the time without these kinds of issues.
Thanks,
Dave

Go To \wamp\bin\php\phpX.Y.Z\wampmanager.conf.
Edit wampmanager.conf via Notepad++
Add This Codes.. And Save wampmanager.conf
$phpConf['apache']['2.4']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['2.4']['LoadModuleFile'] = 'php5apache2_4.dll';
$phpConf['apache']['2.4']['AddModule'] = '';
Restart Wamp Manager..

just had a similar problem - was upgrading WAMP from Apache 2.2 / PHP 5.3 to Apache 2.4 / PHP 5.4
This is what worked for me:
Stop apache service
Remove the unwanted version's apache service using WAMP manager's 'Remove service' option. (check in Windows services if really removed)
Manually edit the 'wampmanager.conf' in the WAMP's installation directory to use Apache and PHP versions you want to use (sections: 'php', 'phpCli' and 'apache' / properties 'xVersion' and 'xLastKnown')
Shutdown WAMP manager
(Re)Start WAMP manager
(Re)Install the wanted version's apache service using WAMP manager's 'Install service' option. (check in Windows services if really installed)
(Re)Start apache service
NOTE: Always run WAMP manager as admin
... After this phpinfo() shows new Apache and PHP versions and seems to work fine.
Hope it helps.

The problem is WAMP version 2.4. I don't know why but v2.4 is not compatible with addons. Then I tried 2.2E. It was fine with addons.
By the way, addons compiled for 32bit. So do not install 64bit Wamp if you think that you would use addons.

When updating WAMP from 2.2 to 2.4 or switching from Apache 2.2.22/PHP 5.3.13 to Apache 2.4.4/PHP 5.4.12, WAMP installs new service as Apache/2.4.4 (Win64) PHP/5.3.13 to make it use PHP 5.4.12
1) Uninstall apache service
2) Modify
C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf
Change line
LoadModule php5_module "c:/wamp/bin/php/php5.3.13/php5apache2_4.dll"
to
LoadModule php5_module "c:/wamp/bin/php/php5.4.12/php5apache2_4.dll"
3) (Re)Start WAMP
4) Install Apache Service
5) Restart all services
Verify the service description of service wampapache in windows service manager to match Apache/2.4.4 (Win64) PHP/5.4.12

I had this same issue - what I finally did was follow ofzza's and Ankit Sharma's tips, as well as manually removing the directory of the older php version while the services were stopped.
It seems to have worked, except when I call phpinfo() the top heading still claims it's the older version of php even though it's definitely running the newer one. Very strange, but everything is working so I'm fine with it.

The previous installation could be part of the problem. Install WAMP 2.4 in a new directory (It comes bundled with the Apache version you want) & then migrate your www folder.
Directly upgrading has not been error-free for me.
Alternatively, back-up your current version [Databases, config files & www dir], uninstall it and install the new version. Restore your information after

Related

EParseError wamp: The configuration files contains syntax error on line 592. Unknown parameter name "type"

I tried to update php version from 7 to 8.1 through add on in wamp 3.2.5. Also Edited the path in the environment variable. But I'm facing this issue when I run the wamp server a pop up is displayed with the above error.
You require WAMPServer 3.2.6 to run PHP8.1.
You can get the upgrade from The Backup repo here. its easier to find on there than SourceForge, but it is available there also if you prefer.
Direct link to the WAMPServer 3.2.6 upgrade
This upgrade will not make any changes to Apache/MySQL/mariaDB/PHP or anything other than the WAMPServer internals. It is a cumulative update and therefore can be run on any version of WAMPServer greater than or equal to 3.0.1.
---Changelog Wampserver 3.2.6
Support for PHP 8.1
Improve default_file for MySQL and MariaDB service
Support of Apache Graceful Restart
Restart Wampserver in one click
Display date/time of last startup
Apache configurations comparison
Ability to update Apache configuration when changing version: LoadModule - Include - Listen port - httpd-vhosts.conf - httpd-ssl.conf
openssl.cnf - apache2.4.xx\conf\Certs\ folder if existing
Ability to restore httpd.conf and httpd-vhosts.conf saved when installing an Apache version
Improved display of command windows
Ability to check for updates to Wampserver, Aestan Tray Menu, Apache, PHP, MySQL, MariaDB, etc.

How to configure PHP Intl extension on MacOS Mojave? [duplicate]

I followed a guide which used home-brew to install the lastest version of php (5.4.8) on OSX Mountain Lion.
I then followed a guide which showed me how to setup and use the pre-installed apache on OSX.
However when I try running up a base Symfony 2 project I get a bunch of errors relating to missing date.timezone in the php.ini.
However I have this correctly setup the php.ini but doing a quick phpinfo() in the Symfony project shows that its using the old preinstalled version of php (5.3) rather than the new one.
In terminal if I type which php & php -v, It shows the correct new version is being used.
But the phpinfo() shows
Did you follow all the instructions provided in the Caveats?
Run brew info php54 to see them again.
Especially the line:
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so
Apache is not aware of the homebrew version of PHP (i.e. /usr/bin/php). You see it on the command line because you've likely modified your PATH (i.e. /usr/local/bin/php).
You can modify this in your httpd.conf file.
I am not a fan of homebrew or other package libraries. Primarily because Mac OS X is built atop Unix. Furthermore, all but MySQL are installed natively. Here's an article on installing Apache, MySQL, and PHP on Mac OS X.
Disclaimer: I wrote that article.
Today I have same issue for updating php 7.2 to 7.3 as requirement of Laravel 6. Here is my solution.
Open your httpd.conf file in "/etc/apache2/http.conf"
Search (Ctrl + w) for "LoadModule php"
Uncomment that row
Restart your apache with "sudo apachectl restart"
Then, your php version in local web server (apache2) will be updated

How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1?

I want to downgrade php version from 7.1.1 to 5.6 in xampp 7.1.1. But I can't find any option.
I think the most safest downgrade path from PHP7 to PHP5 in Xampp is:
Download a self-packaged version of Xampp with PHP5 from here (as of today this is xampp-win32-5.6.37-0-VC11.zip).
Rename the php folder to php7 in Xampp.
Now copy the php folder from xampp-win32-5.6.37-0-VC11.zip into your Xampp install folder.
Make a backup from .\xampp\apache\conf\extra\httpd-xampp.conf file.
Replace this file from xampp-win32-5.6.37-0-VC11.zip as well.
This way the config files (including php.ini) has settings from the Xampp team.
Before any changes, to verify changed Apache configs, you can compare both Xampp release folder at .\xampp\apache\conf with tools like Meld.
I should note that please download PHP 5 and 7 Xampp packages released at the same time.
Notify me if I miss something.
If you want to downgrade php from 7.1.1 to 5.6 in xampp follow the steps(For Windows):-
Go to https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/
Download and extract the file xampp-win32-5.6.36-0-VC11.zip see the image
[image 1][1]
Delete php folder and apache folder present in C:\xampp
Copy php folder and apache folder from extracted file and paste it to C:\xampp
Add " C: " before \xampp\ to php ini file present in php folder.
Start your apache and MySQL and check php version. It will show php 5.6.36
Just delete this xampp, and download 5.6 version.
There is no option to downgrade XAMPP. XAMPP is hardcoded with specific PHP version to make sure all the modules are compatible and working properly. However if your project needs PHP 5.6, you can just install a older version of XAMPP with PHP 5.6 packaged into it.
Source: How to downgrade php from 5.5 to 5.3
Change the .htaccess code to switch to PHP 5.6:
AddHandler application/x-httpd-php56 .php
XAMPP is an integrated package and you can not downgrade or change one of its component such as php. (There are some solutions that you can use but there is little chances that everything work fine.)
You can download the package from these links:
https://www.apachefriends.org/download.html
https://sourceforge.net/projects/xampp/files/
You had better to download the old package form sourceforge.net.
You do not have to install another version of Xampp. I've managed to use PHP 5.6 on my Xampp PHP 7 version. Here is what you need to do to make it works:
Raname (backup) <XAMPP_DIR>\php to <XAMPP_DIR>\php~7
Copy (backup) <XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf to <XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
Download PHP5 and unpack it to <XAMPP_DIR>\php
Edit <XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf and change all php5 occurrences to php7. You need to change php7apache2_4.dll to php5apache2_4.dll, php7ts.dll to php5ts.dll and php7_module to php5_module
Ensure all your paths are correct like extension_dir in php.ini.
Restart Apache and voila.
If you want to downgrade php version, just simply edit yout .htaccess file.
Like you want to downgrade any php version to 5.6, just add this into .htaccess file
<FilesMatch "\.(php4|php5|php7|php3|php2|php|phtml)$">
etHandler application/x-lsphp56
</FilesMatch>
I know it might be late but I'm just adding to Lanti's answer since it's the most popular, I had the same problem as Wouter Vanherck in the comments and I can't comment yet.
What helped for me was instead of just replacing \xampp\apache\conf\extra\httpd-xampp.conf I replaced the whole apache folder. I basically did the same thing with it as with the php folder (steps 2 and 3).
Now the error is fixed and Apache starts just fine.
Using WAMP is perforce option if we want to use more then one version of php.
It is very easy to do, all you need to do is
1) download 5.6 from [1]: https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/, the run the setup and install in folder "xampp"
2) download 7.6 from [https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/7.4.2/xampp-portable-windows-x64-7.4.2-0-VC15-installer.exe/download][1] and run the setup in "xampp2"
NOte: after that you now have separate xampp installed in your system. all you do now is to run each xampp as a separate entity. Alway quite the 5.6 if you want to run 7.6
This solution is Only for local system / localhost on windows:
The simplest way to install xampp 5.6.X version as per your requirement in other windows drive then run xampp 5.6.X services from it's control panel for php 5.6 version.
NOTE: If you already have xampp (any other version) on your system then please close that xampp's services then start xampp 5.6.x services otherwise this solution will not work.
You can download your required (xampp 5.6 as per question) xampp version from below link:
https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/
I have used this solution many times, it worked like charm. I hope this will also help you. Thank you to ask this question.
i was trying the same, so i downloaded the .7zip version of XAMPP with php 5.6.33 from
https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.33/
then followed the steps below:
1. rename c:\xampp\php to c:\xampp\php7
2. raname C:\xampp\apache\conf\extra\httpd-xampp.conf to httpd-xampp7.OLD
3. copy php folder from XAMPP_5.6 7zip archive to c:\xampp\
4. copy file httpd-xampp.conf from XAMPP_5.6 7zip archive to C:\xampp\apache\conf\extra\
open xampp control panel and start Apache and then visit ( i am using port 82 instead of default 80)
http://localhost
and then click PHPInfo to see if it is working as expected.
Opening localhost shows dashboard
Opening phpinfo shows version 5.6

XAMPP Apache not starting because of Apache2.4

So I'm starting to use MySQL and phpMyAdmin and I firstly installed Apache2.4. After installing Apache2.4 there were numerous errors so I decided to install XAMPP instead. Now me not thinking through the consequences deleted the Apache2.4 Folder completely along with all its contents.
So now when I start XAMPP, MySQL runs fine but Apache is stuck on "Attempting to start Apache service..." Now when I look at the services tab Apache2.4 is still on my list, I have disabled it but it's made no difference. I have checked through my computer for any remaining Apache2.4 files but I can't find any.
If anyone can help me with this, it would be extremely helpful!
UPDATE: I have restored Apache24 from my recycling bin, should I attempt a uninstall using cmd?
It appears that an instance of apache 2.4 is running on the system. It is probably locking port 80 which the reason why XAMPP apache is unable to start.
Shutdown apache 2.4 from it's control panel, shutdown the service, and ensure there is no "httpd" process running using task manager. If there is kill it.
Once the above are done you should be able to start xampp.
Follow those steps:
1- Uninstall Apache 2.4
2- Clean Windows Registry with a tool like CCleaner
3- Restart Windows
4- Install XAMPP

Windows 7: PHP 5 Configured with Apache 2.2 when run from Console but not as Service

I'm on Windows 7 and I have installed Apache 2.2, PHP 5 (latest stable build) and MySQL.
I have configured PHP 5 with Apache 2.2 as a module (i.e. LoadModule and AddType statements added in httpd.conf).
Everything seems to work when I start Apache from the console (command prompt) but PHP would not work when the Apache service is started. In this configuration, the localhost/index.php ends up getting downloaded in the browser. Why is that?
My guess is that the Apache Service loads up its own version httpd.conf file. Anybody faced similar problems?
DO note:
- I know of XAMPP, WAMP etc and I don't want to use them
- I don't want to use PHP as CGI
I finally switched to XAMPP. But I feel this has to do with some of the default security settings in Windows 7. WinXP gives me no problem.

Categories