Major of instructions were taken from StackOverflow. Though I didn’t follow all steps plus I also had to deal with SSL module. Anyway the migration was fast and flawless. Just don’t forget to backup you website 🙂
Here are my instructions if you followed AWS tutorial to setup WordPress on Apache with SSL. Note that following these instructions is relatively safe and doesn’t corrupt any WordPress files (if you on Amazon Linux).
- Stop Apache and remove httpd 2.2 and PHP 5:
sudo service httpd stop sudo yum remove httpd* php*
- Install Apache 2.4 and mod_ssl
sudo yum install http24 sudo yum install mod24_ssl
- Install PHP 7 and required modules
sudo yum install php70 sudo yum install php70-mysqlnd sudo yum install php70-gd
- Update Apache configuration to react on index.php files:
sudo nano /etc/httpd/conf/httpd.conf
Find dir_module section and update it to:
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
Find <Directory "/var/www/html"> and update it to:
<Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
- Now it’s time to copy back your SSL configuration:
sudo mv /etc/httpd/conf.d/ssl.conf.rpmsave /etc/httpd/conf.d/ssl.conf
- Final steps: adding httpd to boot sequence and launching it:
sudo chkconfig httpd on sudo service httpd start
Voila! Your WordPress should be back online running on PHP 7! Many thanks to WordPress, PHP, Apache and Amazon people who surely worked hard to make such transitions so simple and burden-free.