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

Drfraker's avatar

Upgrade php from 7.0.5 to latest stable version 7.0.23

I have a production application that I've upgraded from Laravel 5.3 to 5.4. A few of the dependencies will not run on php 7.0.5, which is what is installed on my production server. I would like to update php to the latest stable version 7.0.23. Since it is a live application on a production server it would be best if this update could be done without any downtime.

I have searched on the web and read that running apt-get install php7.0 --only-upgrade is the command I need to run. However, after running that command when I run php -v from the cli it still returns php 7.0.5.

0 likes
4 replies
Cronix's avatar

php -v from the cli will return what version of php-cli you are running (not necessarily the same version as what your webserver is running - they are different).

put phpinfo(); in a php file and visit the url for that file in a browser (or at the top of /public/index.php)

Drfraker's avatar

Hey @Cronix thanks for the reply. I would want to make sure that php-fpm and php-cli are the same and that I can run the update without any downtime. I did run php -i on the server, which I think outputs the same thing as phpinfo() and saw that it is still php 7.0.5.

Any advice on performing the upgrade? I'm sure a ubuntu ninja could do this in 10 seconds. I'm just afraid that I'll screw something up and have a ton of calls because the app is down.

36864's avatar

This may sound like a silly question, but did you restart you webserver after updating?

Drfraker's avatar

@36864 Yea, I restarted. What I ended up doing was creating an entirely new server, pushing code to it. Setting my machines /etc/hosts file to point to the new server IP address. Once I had everything set up, I changed my DNS to direct traffic to the new server. Worked much better than worrying about the version of PHP I had and possible bringing down the app while making server changes.

Please or to participate in this conversation.