Created
May 2, 2017 01:38
-
-
Save mavieth/b6b3b622dd9f863ca2c7db2da04ab215 to your computer and use it in GitHub Desktop.
Upgrade from PHP 5.X.X to PHP 7 on an AWS EC2 Linux Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "===============================" | |
echo "Installing PHP 7" | |
echo "===============================" | |
sudo yum install php70 | |
echo "===============================" | |
echo "Installing PHP 7 additional commonly used php packages" | |
echo "===============================" | |
sudo yum install php70-gd | |
sudo yum install php70-imap | |
sudo yum install php70-mbstring | |
sudo yum install php70-mysqlnd | |
sudo yum install php70-opcache | |
sudo yum install php70-pecl-apcu | |
echo "===============================" | |
echo "Linking PHP 7" | |
echo "===============================" | |
sudo ln -sf /etc/httpd/conf.d/php-conf.7.0 /etc/alternatives/php.conf | |
sudo ln -sf /etc/httpd/conf.modules.d/15-php-conf.7.0 /etc/alternatives/10-php.conf | |
echo "===============================" | |
echo "Choose PHP 7 as an Alternative" | |
echo "===============================" | |
sudo alternatives --config php |
Awesome!! this also seemed to work seamlessly with PHP 7.2 by replacing all the 70 or 7.0 to 72 or 7.2!
TY so much!
Useful, thanks!
Few hiccups, but those were on my end. Great job! Thank you!! As an alternative, I would offer the command line sudo update-alternatives --config php
thank you so much
thank you so much
No problem I'am glad that you found it useful!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, a query, it is not necessary to uninstall php5.6 first? how would the process for such an uninstall be, thank you very much! Regards!