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

dascorp's avatar
Level 26

Downgrade PHP from 7.1 to 7.0 on digitalocean

Hi, is it possible to downgrade PHP to 7.0 from 7.1? Could you give me a hint how to do this. on Mac brew sorted it in no time. Why? dompdf/dompdf 0.6 does not work with PHP7.1 (I can't update this package to 0.8 as I'm still on L5.2). At this moment cashier invoices throw errors when rendered. I could provision new server with 7.0 as default but moving all sites and DNS will probably take more time.

cheers B

0 likes
9 replies
dascorp's avatar
Level 26

Ok, So id did screw up. nginx is scrambled after installing 7.0; for some reason all apps show Debian apache default page now.

I am deploying new droplet now. :(

Note to self: Make a droplet snapshot before u mess up.

1 like
jlrdw's avatar

@dascorp if you have a real production site make another note, lag 2 versions behind. Most enterprise including State Governments don't update to the latest thing. They lag back several months to ensure all is ok.

dascorp's avatar
Level 26

noted. The production server still runs PHP5.6 and L5.2. This issue is with staging server, unfortunately created it with PHP7.1 as I was not aware of PDF issue;

I managed to find 2months old snapshot on DO, so I recovered the server without provisioning new one.

It would be nice to have forge configured to run 3 versions of PHP and each site to select which one to use.

if somebody has tutorial how to do this, please give us a hint.

dascorp's avatar
Level 26

Do you know any forge recipies for the harmless downgrade of php to 7.0?

ejdelmonico's avatar

SSH into the server and check nginx config that the php fpm version is changed back to 7.0

dascorp's avatar
Level 26

@ejdelmonico i have 7.1 server provisioned my nginx config for app looks like

location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

i think i need to install 7.0 first but when i did this last time all went wrong

Please or to participate in this conversation.