Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

spar_x's avatar

upgraded to php 7.1 but some apps are still using 7.0 and 7.1 ??

This is soo weird. I upgraded to php 7.1 by running these

sudo apt update

sudo apt-get install php7.1

sudo apt-get -y install libapache2-mod-php7.1 php7.1-fpm php7.1-common php7.1-cli php-pear php7.1-curl php7.1-gd php7.1-gmp php7.1-intl php7.1-imap php7.1-json php7.1-ldap php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-ps php7.1-readline php7.1-tidy php7.1-xmlrpc php7.1-xsl sudo apt-get -y install php7.1-apcu php7.1-curl php7.1-fpm php7.1-gd php7.1-gmp php7.1-json php7.1-mbstring php7.1-pgsql php7.1-readline php7.1-xml php7.1-zip sudo apt-get -y --purge autoremove

sudo service php7.1-fpm restart

This worked fine or seemed to. I was now on 7.1.

My laravel app in development was still working including its connections to mysql.

Then today I tried to use supervisord-monitor a cool gui app for managing supervisor and it complained that php7-xmlreader was missing. So I did a bit of digging and it recommended that I install php7.1-xml which I did.. if you look above you'll see I already had. So it said I already had the latest version. Then later.. out of answers I tried installing php7.0-xml and it fixed the problem!

Now even weirder.. my laravel app which connects to many DBs and uses both the DB Query Builder and Eloquent.. today my functions that use Eloquent are working! But I tried a function that uses Schema:: directly and it failed.. saying "couldn't find driver" ???

After a bit of digging.. I made sure I had php7.1-mysql installed.. which I did.. So I reinstalled php7.0-mysql and problem fixed ???!

How come my laravel app is using both 7.1-mysql and 7.0 mysql ?? Would appreciate any hints on how to fix this mess I've caused.

I tried rebooting, clearing cache.. only installing php7.0-mysql fixed it

0 likes
3 replies
spar_x's avatar

I did the upgrade on a forge server.

I decided to just start a new server and migrated my previous forge droplet to the new server. It was just too much of a headache. But the migration was a headache as well. It's making me realize that by continuing to use Forge I am actually shooting myself in the foot, I should be learning to use real provisioning solutions such as Chef or Ansible because Forge, as convenient as it is, is also very slow and clunky at times. For example there is no way to actually upgrade the php version fully. Even if you perform the correct upgrade path, Forge will still continue to use the old php version when creating new sites and the nginx vhost configs will be wrong and will need to be manually edited every time.

ejdelmonico's avatar

I would say that if you have the need for highly customized servers, then Forge is not really helping you. I would definitely switch to maybe Ansible or just use Envoy to write your provisioning. You can find a few articles and videos on https://serversforhackers.com.

Personally, I do not try to upgrade PHP on my Forge servers. I just provision a new server and spend an hour installing and setting up all the previous services. Seems to work fine for me so far.

Please or to participate in this conversation.