By ivinroekiman
Hi there guys, so I installed Vesta control panel on my 1gb memory droplet. I’ve got nginx running in the front and apache in the back.
I’ve upgraded to php 7 with putty and when I type in “php -v” in the CL, it shows that I’m running php 7.
So in order to test things out, I decided to create a file called phpinfo and when I run it, it says that I’m running “5.5.9-1ubuntu4.14”
I’ve also got Wordpress installed and when I run the system status, it also shows that I’m using 5.5.9
SO now I’m confused. Which version am I really using and how can I switch (default) to php7?
Thank you for your input
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!
Without knowing what distro you are using or how you upgraded to PHP 7, it is hard to give a thorough answer. Assuming you are on Ubuntu 14.04 and used the packages from the ondrej/php PPA, here are some things to check.
The way PHP is now packaged, you are able to co-install both PHP 5 and PHP 7. So it is possible to have both versions working with different applications.
If your PHP is being executed by Apache’s mod_php, first ensure that you have the package libapache2-mod-php7.0 installed on your system. Then, disable the PHP 5 version and enable the PHP 7 one:
- sudo a2dismod php5
- sudo a2enmod php7.0
- sudo service apache2 restart
If Nginx is serving the PHP application using PHP-FPM, then ensure that the php7.0-fpm package is installed on your system. Then update your Nginx configuration’s fastcgi_pass directive from:
fastcgi_pass unix:/var/run/php5-fpm.sock
to
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
Remember to restart Nginx for the changes to take effect: sudo service nginx restart
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.