1

Currently using PHP version is 5.6.36 and I need to go down on version 5.3.29.

Running phpinfo()on my script giving me this

enter image description here

While on my cli

enter image description here

For what I understand, I'm still using the version 5.6.36.

Anyway to point the version to different installed php?

Drenyl
  • 906
  • 1
  • 18
  • 41
  • No, you need to upgrade to a supported version of PHP. PHP 5.6 reached end-of-life last December, and 5.3 went end-of-life five years ago. –  Apr 11 '19 at 03:40
  • Does this answer your question? [Switch php versions on commandline ubuntu 16.04](https://stackoverflow.com/questions/42619312/switch-php-versions-on-commandline-ubuntu-16-04) – OMi Shah Oct 30 '22 at 04:23

1 Answers1

3

Your CLI is referenced to PHP-CLI binaries. But Apache uses its internal module (libapache2-mod-php) to process PHP scripts. You have to downgrade the version of libapache2-mod-php.

Try with below commands

# Install the old version of libapache-php
sudo apt-get install libapache2-mod-php5

# Disable PHP 5.6 module
sudo a2dismod php5.6

# Enable php 5.3 module
sudo a2enmod php5

# Restart Apache
sudo service apache2 restart
srimaln91
  • 1,176
  • 10
  • 21