M
M
Maybe_V2016-12-16 16:00:09
PHP
Maybe_V, 2016-12-16 16:00:09

How to change php version for apche2?

I always worked with linuxand there were no problems with it, but now I started working on Mac OS X EL Capitanit and the problem is this:
It costs php55 and php56 to be installed through homebrewand the problem is what I do in the console it php -vgives out PHP 5.6.29, but phpinfo()it shows:
812c52dd026e4362939c131272ad9aff.png
That is, the console version and the version for are apache different!
Please help me change the version for apache a newer one! I can not understand !
How to do it ? !

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
unet900, 2016-12-16
@unet900

And how do you have php connected to Apache, most likely as an Apache module. Check the Apache module version.
LoadModule php5_module /usr/lib/apache2/modules/libphp5.5.8.so like this in config Enter the
version of the required module there. There was also a console command to enable the required module in Apache (sudo a2enmod php7.0 see below)
PS Apache was rebooted after all the manipulations ?? Need to reload
PPS
Switch PHP version ( Apache ):
from php5.6 to php7.0:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
from php7.0 to php5.6:
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
from here askubuntu.com/questions/756879/cant-install-php5-o...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question