📜 ⬆️ ⬇️

WAMP: before installing a new release

Translator's Preface

Having very little experience with the WAMP toolkit (Windows Apache / MySQL / PHP), I was faced with the need to reinstall it both with the goal of updating versions of its component parts, and with the goal of installing openssl. Openssl, in turn, is necessary for me to use composer, and composer for installing Laravel 4. I need Laravel 4 just out of curiosity - I want to try a new version of a popular framework. Now you know what led me to the translation of this article, which I stumbled upon while searching for tips from experienced people who have already passed this way on the forum.wampserver.com . The article is fresh, dated October 11, 2013, it is possible for some of you to use it. So…

This process is not one of those where you click the “Next” button several times, then “Finish” and with this you can consider your task as completed. Here there are lots of traps that you can please. But the result is achievable if you attract a bit of common sense!

Do not start this process if you have only 20 minutes. This may be enough, but, depending on the level of your skill, as well as the number of releases of all 3 pieces of software that you missed, it may take a long time.

The whole process is based on the fact that the installation of WAMPServer basically simply copies the files to disk, knowing only which disk is being installed. Only two Windows services are tied to the installation folder of the installation - 'wampapache' and 'wampmysql'. Therefore, if we remove them, and in wampmanager there is such an option in the menu (Service-> Remove service , - comment of the translator), then it can be argued that your original installation has been deleted.
')
First of all, make backup copies of all your databases (DB) in Format = SQL format, keeping in mind that your databases are not the ones that come with MySQL. Keep your backups in a safe place ready for use.

The databases that come with MySQL are 'mysql', 'information_schema' and 'performance_schema', you don’t need their backup copies unless you are sure of the opposite and you know for sure that you need them.
Also, you do not need a 'test' database if you have not used it for something that needs to be saved.

If your databases range from small to medium, then you can easily use phpMyAdmin to create backups.

If the database is large and phpMyAdmin was unable to create a backup, (this is usually due to a limitation set in the PHP setting max_runtime ), then you can create a backup using the mysqldump.exe utility. Read more about it on the site dev.mysql.com .

Further, if all your sites connect to their databases using 'localhost', 'root' and '' (empty password), then you don’t need to do anything else in this regard. ( THOUGH SO TO DO - A BAD IDEA ).

If you have a password for the root user and you use ('localhost', 'root' and 'some_am_am_installed_password'), then you just need to remember this password to set it in the new version of MySQL ( SO TO DO IT IS A BAD IDEA ).

If you do business properly and create a unique MySQL user and password for each database of your sites, then you should record the user IDs and their passwords in order to recover them in the new version of MySQL.

Or you can use phpMyAdmin to export users as SQL statements, save them and use them in the new version of MySQL.

So before installing a new version of the WAMP server

In fact, there are only 2 things installed by WampServer - these are the Apache and MySQL services.
Therefore, we delete these 2 services:

1. Launch WampServer
2. wampmanager -> Stop all Services
3. wampmanager -> MySQL -> Service -> Remove service
4. wampmanager -> Apache -> Service -> Remove service

Now stop wampmanager by right-clicking the wampmanager -> Exit menu.

Rename the wamp folder to something like wamp_old. This is your backup!

Now you can install a new copy of the WAMP server, let 's do it.

Download and install a new WAMP server, installation can be performed on any C, D, E drive, etc., can be installed in the root directory of the drive, for example C: \ wamp, but do not install the package in the C: \ Program Files \ directory

Check the performance of your installation as follows:

1. The wampmanager icon in the system area should become GREEN.
2. Run: wampmanager -> localhost
3. Click on the link phpMyAdmin, make sure it works.

WampServer 2.4 comes with a different phpmyadmin configuration, so initially, when it starts, the login page loads. Remember that in the new installation, username = root and the password is NULL.

If you still have problems, remember that this new installation does not contain all the changes that you might have made in the previous installation. Therefore, right now you can compare your old and new configurations and transfer the necessary settings from the old configuration to the new one.

Remember that you are updating Apache, MySQL and PHP , and the parameters of this whole trio could change / be deleted or new ones added !!!

Therefore, do not just copy them from the old wamp configuration to the new one.
YOU WILL HAVE PROBLEMS!
(it was literally - DRAGONS WILL APPEAR, - comment of the translator)
That is why we did not delete the old wamp folder, first you need to make sure that the new installation works correctly.

These are the files you should definitely pay attention to, but depending on what you did with Apache / PHP / MySQL, there may be others and only you can know about it.

Each change in these files must be accompanied by the Apache and MySQL health check:

https.conf,
\ wamp \ alias \ phpmyadmin.conf,
\ wamp \ alias \ sqlbuddy.conf,
\ wamp \ alias \ webgrind.conf,

If you are using Apache 2.2.x, make sure that Apache security is configured as follows:
Order Deny, Allow
Deny from all
Allow from 127.0.0.1 localhost :: 1
plus those specific ip-addresses that you gave access to Apache from your network, for example,
Allow from 192.168.0
will give access to the server to any ip from your internal network.

If you are using Apache 2.4.x
It's time to read the attached post Wampserver 2.4 What to do after Installing .

Your php.ini uses Apache
(to access the file, click wampmanager -> PHP -> php.ini), the file is actually located in the \ wamp \ bin \ apache \ apachex.yz \ bin \ php.ini folder, but open it using the specified menu to edit it.

Your php.ini is using PHP CLI
If you really use PHP CLI (edit the file \ wamp \ bin \ php \ phpx.yz \ php.ini)

Compare your old and new versions of files, remember that the settings could change, extensions could be added to the php kernel, and therefore not needed as extensions, etc.

Your my.ini
And again, remember that a lot could have changed, some parameters would disappear, others would be added, etc.
For example, if you use the INNODB database, then you need to activate the innodb parameters, which are commented out by default.
You can visit the mysql website, they have a “How to upgrade” page for all versions of this DBMS.
Here is an example - dev.mysql.com .

If you upgrade to mysql 5.6, you may want to add this parameter in order to reduce the amount of memory allocated for MySQL. By default, about half a gigabyte of memory is allocated, this setting will reduce the amount allocated to a more acceptable one. Set this setting in accordance with the capabilities of your system !!!
table_definition_cache = 800

Now you can return to restoring users of MySQL and your databases in the new version of MySQL.
If you are updating a VERY OLD version of MySQL, do not forget that the recovery process may not be so simple. You may have to fix a couple of things before the new version of MySQL can accept your old data. This is a rather rare situation, but it can happen. And again I remind you - do not do the update 10 minutes before you will need to show a presentation using the new version of WampServer.

Transfer your websites to a new copy of WAMP
Just copy your \ wamp_old \ www \ * directory to the \ wamp \ www \ directory

Transferring virtual directories to a new copy of WAMP
In this case, you can move the file extras \ https-vhost.conf from the directory containing the old version of Apache to the directory with the new version of Apache.
Remember that the instructions in this file may need corrections according to the rules of the new release of Apache.
At a minimum, check the changes to 'Allow from', 'Require', and also remove the comment line from 'Include conf / extra / httpd-vhosts.conf' in your new httpd.conf file.

Transferring old versions of Apache, MySQL and PHP from the old version of wamp to the new one
Remember that one of the strengths of WAMPServer is the ability to switch between multiple versions of Apache, MySQL and PHP.

Therefore, you can transfer them to a new installation of WampServer.

Copy?: \ Wamp-old \ bin \ apache to?: \ Wamp \ bin
Copy?: \ Wamp-old \ bin \ mysql to?: \ Wamp \ bin
Copy?: \ Wamp-old \ bin \ php to?: \ Wamp \ bin

It must be remembered that perhaps the first time you installed WampServer, which knows nothing about Apache 2.4, and also that NOT ALL versions of PHP will work under Apache 2.4.
Basically, because when they were compiled and linked, Apache 2.4 did not exist yet, and the interaction between Apache and PHP was changed in Apache 2.4.

So, in ALL versions of your PHP in the directory?: \ Wamp \ bin \ php \ phpx.yz \ there is a file named wampserver.conf.
In older PHP releases, it may look something like this:

<?php $phpConf['phpIniDir'] = '.'; $phpConf['phpExeDir'] = '.'; $phpConf['phpConfFile'] = 'php.ini'; $phpConf['apache']['1.3']['LoadModuleName'] = 'php5_module'; $phpConf['apache']['1.3']['LoadModuleFile'] = 'php5apache.dll'; $phpConf['apache']['1.3']['AddModule'] = 'mod_php5.c'; $phpConf['apache']['2.0']['LoadModuleName'] = 'php5_module'; $phpConf['apache']['2.0']['LoadModuleFile'] = 'php5apache2.dll'; $phpConf['apache']['2.0']['AddModule'] = ''; $phpConf['apache']['2.2']['LoadModuleName'] = 'php5_module'; $phpConf['apache']['2.2']['LoadModuleFile'] = 'php5apache2_2.dll'; $phpConf['apache']['2.2']['AddModule'] = ''; ?> 


This file tells wampmanager which libraries are called by the PHP interpreter and which main version of Apache they are compatible with.
This information is used when switching between versions of Apache and PHP using the WampManager menu.
Older versions may not contain such instructions for Apache 2.4, so you will have to add them yourself.

Add this new section only if your version of PHP contains the file php5apache2_4.dll in its directory.
If it is missing, and they exist only for PHP versions> 5.3.17 or so, do not add a new section to wampserver.conf.

 $phpConf['apache']['2.4']['LoadModuleName'] = 'php5_module'; $phpConf['apache']['2.4']['LoadModuleFile'] = 'php5apache2_4.dll'; $phpConf['apache']['2.4']['AddModule'] = ''; 


So, if you are using Apache 2.4.x, and your PHP version does not contain the php5apache2_4.dll file, then you will see a small entry denying icon next to this version if you go to the WampManager menu and look in the PHP -> Versions section. This is a visual confirmation that you should not have switched to this version of PHP using the current version of Apache. Of course, you can change your version of Apache to one that is compatible with this version of PHP and the visual display will change.

But remember that this mechanism is controlled by a unique file for each version of PHP file wampserver.conf. You cannot simply add version 2.4 information to each file, but only to those that actually come with the php5apache2_4.dll library. And, anticipating your question, I will assume, just assume that it may be possible to recompile old versions of PHP in order to achieve compatibility with Apache 2.4, but maybe this will not happen. Older versions of PHP are old for a reason, and you should take them into consideration only if you need to create your development environment as close as possible to your code deployment environment. Or if you are using some very old and possibly badly written php code. In this case, you can definitely use the old version of Apache.

If, however, everything goes so damn wrong , and you have to go back to the previous version.

We can return to the original version of wamp like this:

Launch the new WAMPServer and remove the MySQL and Apache services.

wampmanager -> Stop all services
wampmanager -> MySQL -> Service -> Remove service
wampmanager -> Apache -> Service -> Remove service

Now stop wampmanager.
Right-click on wampmanager -> Exit

Rename the current \ wamp folder to, for example, \ wamp_new (or, if you have completely surrendered, you can simply delete it and start from scratch some other time).
Rename the \ wamp_old folder back to \ wamp.

We start wampmanager, the icon on your desktop should work as before, we install the MySQL and Apache services.

wampmanager -> MySQL -> Service -> Install service
wampmanager -> Apache -> Service -> Install service

You must return to the starting point of the update process.
Do not forget to clear your browser's cache (CTRL + F5), so as not to encounter oddities due to switching between installations.

PS Habr for some reason does not consider this a link, because I give a link to the original at the end of the article.
PSS Markup article as close as possible to the original.

Source: https://habr.com/ru/post/198514/


All Articles