Home > Software design >  My PHP version toggles randomly between 7.0.33 and 7.4.13
My PHP version toggles randomly between 7.0.33 and 7.4.13

Time:02-10

I have a strange behavior in my Ubuntu 16.04 after PHP update from 7.0.33 to 7.4.13. phpinfo() randomly takes the PHP version when I refresh the page. I tried to remove 7.0.33 completely but the problem still exists. I tried

sudo apt-get purge php7.*

and then

sudo apt-get autoremove --purge

to remove PHP completely and then reinstall new one again. I olso tried:

sudo a2dismod php7.0
sudo a2enmod php7.4

to change apache2 PHP version. but no success. It seems php version randomly toggles between the two. any help would be appreciated. thanks.

CodePudding user response:

I'm suspecting browser (or some other) cache. When checking the PHP Version, do you go through web browser / web server? If so, display also date() to be sure it's not an old output.

Also, you try checking for PHP version from command line with php -v.

CodePudding user response:

Run one script with phpinfo() command each time when you see version changed. And see which path show for php.ini files. Does it shows separate path for each time ? This way you can get some idea for further debugging.

CodePudding user response:

Do a list of everything PHP installed on your machine with "apt list --installed | grep php". Once you have that list, do a "apt-get remove" for each of the items that have 7.0 in them, then reboot the machine to clear anything running in memory and report back, should be fixed. Also make sure that you don't have an older version of PHP FPM installed (you can have a newer php, but an old FPM as I found out...)

  • Related