I just updated Ubuntu to version 18.04 and I have version 7.2 of PHP, if I execute the command “php -v” I get this result
root@laptop1:/etc/apache2/sites-enabled# php -v PHP 7.2.3-1ubuntu1 (cli) (built: Mar 14 2018 22:03:58) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.3-1ubuntu1, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans root@laptop1:/etc/apache2/sites-enabled#
However, if I run the phpinfo()
command inside a php file through a web browser I get the following: it tells me that I have version 7.1 of PHP and that I do not have the Xdebug activated.
For this reason Xdebug does not work with my PhpStorm IDE; I do not know if the best option is to delete all the PHP versions installed and leave one that is not as recent as 7.0 or 7.1.
Advertisement
Answer
There is a difference between what version of PHP you use in your terminal and what version your web-server (in example apache2) is using. If you have apache2, you can change the version of PHP to 7.2 with the following commands:
Dissable PHP 7.1:
sudo a2dismod php7.1
Enable PHP 7.2:
sudo a2enmod php7.2 sudo a2enmod proxy_fcgi setenvif sudo a2enconf php7.2-fpm
After that restart apache2:
sudo service apache2 restart