I installed PHP 5.6 and when I run php -v it shows
PHP 5.6.30-7+deb.sury.org~precise+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologiesbut when I get phpinfo(); in index file show in header:
PHP Version 5.3.10-1ubuntu3.26How can upgrade my php version?
51 Answer
Open apache config:
sudo gedit /etc/apache2/apache2.confAt the end of the file add the following:
<IfModule php5_module> PHPIniDir "/etc/php/5.6/apache2/php.ini" </IfModule>Restart apache:
sudo service apache2 restart
UPDATE: if that didn't work, try the following in a terminal:
1. Make sure php 5.3 module is installed: sudo apt-get install libapache2-mod-php5.6
2. Disable 5.3 and enable 5.6: sudo a2dismod php5.3 && sudo a2enmod php5.6 && sudo service apache2 restart
With attribution to Grayson Kent, this and this post
5