Hello there i am trying to update my LAMP stack to php7!? I have php5 installed currently.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Upgrading to PHP7 can be done quite smooth. Just use the following commands. First add the new repository for PHP7:
Now backup any custom config files since we will remove PHP5 and install PHP7 now:
At this point, php5-fpm should be removed and the php7.0-fpm service is running. It is, however, unlikely that your website is running properly – because the PHP-FPM socket file will have changed. If you’re running Nginx, you must update your fastcgi_pass directive inside your VHOST from:
to:
Some Nginx instances runs as the user/group
nginx
, if thats true in your situation you need to change the php-fpm file:edit
You might also want to change the
user
andgroup
at the beginning of the file. If you hadwww-data
in php-5, you can just keep this default. Now restart nginx and php-fpm and it should work properly:"This is what worked for me:
For LAMP, you should be able to just update through apt-get:
This is what worked for me.