I've a Ubuntu 16.04 server running nginx + PHP7.1.2. I have a PHP script that is executed by a cronjob, it's giving some compatibilities issues (in PHP 7.0 it works perfectly and other people had the same issue), so, right now I need to downgrade the version of PHP to 7.0.14 (I think that maybe the CLI version?). So how can I do it?


you can disable php7.1 service

sudo a2dismod php7.1

and enable service php of which ever version you want

sudo a2enmod php5.6

then restart your apache

sudo service apache2 restart

This will not uninstall the php7.1 but you can work with downgraded version without error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.