First install python-software-properties package on your system which provides add-apt-repository command then use the following set of commands to add PPA for PHP 7 in your Ubuntu system and install it.
sudo apt-get install python-software-properties sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
Then, remove PHP 5 and install PHP 7.
sudo apt-get update sudo apt-get purge php5-common -y sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y sudo apt-get --purge autoremove -y
You may also need to install modules like PHP7-MySQL, libapache2-mod-php7.0 etc based on your application requirements. Use the following command to find our available php 7 modules.
sudo apt-cache search php7-*
Above command will list all available PHP7 modules for installation, Let’s begin installation of modules.
sudo apt-get install libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-gd
*Installing PHPMyAdmin
Change directory to /usr/share
cd /usr/share
Download PHPMyAdmin using wget
sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.5.4.1/phpMyAdmin-4.5.4.1-all-languages.zip
Unzip it: (you may install unzip first)
sudo unzip phpMyAdmin-4.5.4.1-all-languages.zip
Rename the folder:
sudo mv phpMyAdmin-4.5.4.1-all-languages phpmyadmin
Change permissions for the phpmyadmin folder:
sudo chmod -R 0755 phpmyadmin
Configure apache so that it can find it correctly:
sudo nano /etc/apache2/sites-available/000-default.conf
Anywhere after "DocumentRoot /var/www/html" insert these line:
Alias /phpmyadmin "/usr/share/phpmyadmin/"
<Directory "/usr/share/phpmyadmin/">
Order allow,deny
Allow from all
Require all granted
</Directory>
Restart Apache Server:service apache2 restart
Finally verify installation of PHP7 with Apache2. Let’s create a file info.php on website document root using following content.
<php? phpinfo(); ?>
http://tecadmin.net/install-php-7-0-apache-2-4-mysql-5-6-on-ubuntu/
http://stackoverflow.com/questions/34060036/have-trouble-installing-phpmyadmin-on-php7-apache-2-4-7-ubuntu
http://askubuntu.com/questions/705880/how-to-install-php-7
Comments
Post a Comment