PHP 7 on AMI Linux (EC2)
PHP 7.0.0 just came out. Obviously I want to try it out on my EC2 instance. We are going to use Remi’s repo. Here you can find quick reciepie:
wget http://mirrors.mediatemple.net/remi/enterprise/remi-release-6.rpm sudo yum install remi-release-6.rpm
PHP 7.0 requirs epel repo to be enabled, so wee need to enable epepel repository by editing
nano /etc/yum.repos.d/epel.repo and set
enabled=1 on that.
sudo yum upgrade -y sudo yum install php70 php70 -v
PHP 7.0.0 (cli) (built: Dec 3 2015 17:57:06) ( NTS ) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
Moving forward with Apache configuration if you are looking to use PHP in your server instead of command line online, you have to install additional packages. So if you are using PHP as a FPM module:
then you can just follow instructions on my previous article.
It’s worth while to install some additional PHP packages:
yum install php70-php-xml php70-php-pdo php70-php-mysqlnd php70-php-gd php70-php-pecl-apcu php70-php-mbstring php70-php-mcrypt php70-php-mysqlnd php70-php-opcache