I’m trying to downgrade PHP
version from 7.4
to 7.2
. This is what did
sudo amazon-linux-extras | grep php
and it showsPHP 7.4
as the enabled version.
- Disable PHP 7.4
sudo amazon-linux-extras disable php7.4
- Enable PHP 7.2
sudo amazon-linux-extras enable php7.2
- Installing related modules
sudo yum install php php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap}
- Checking the enabled version again
sudo amazon-linux-extras | grep php
Now it shows 7.2
as the enabled version.
- Restarting httpd
systemctl restart httpd.service
After this when I check php -v
it still shows 7.4
Can anyone point out what I’m missing.
2
Answers
Reinstalling worked for me.
Uninstall PHP
yum -y remove php*
Reinstall PHP and related modules
sudo yum install php php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap}
Probably your php path variable is not pointed correctly.
Please do check the path variable in your centOS configuration once again.