Page 1 of 1

[SOLVED]PHP 7 and Ubuntu

Posted: Thu May 26, 2016 8:17 pm
by nickcraig
Does anyone have a guide on how to get php7 up and running on Vesta using Ubuntu? I have tried a few different things and nothing seems to work.

Re: PHP 7 and Ubuntu

Posted: Thu May 26, 2016 9:27 pm
by nickcraig
So I have PHP 7 installed and when I run "php -v" I see that but phpinfo still shows php 5. How do I tell Apache to look for PHP 7?

Re: PHP 7 and Ubuntu

Posted: Thu May 26, 2016 10:22 pm
by mehargags
First, learn how to ask questions on Support Forum. Mention your OS Version and your Server Specs.
Second, Learn to search the forums before asking such a generic question.
Third, Quote the procedure/guide you followed, the commands you issued to install your PHP7.
nickcraig wrote: I have tried a few different things and nothing seems to work
What did you try ? how do we know ? what failed ?
nickcraig wrote:I run "php -v" I see that but phpinfo still shows php 5
Please state how you installed PHP7 to let us know where the problem can be.

Re: PHP 7 and Ubuntu

Posted: Fri May 27, 2016 2:25 pm
by nickcraig
So I am running Ubuntu 14.04 with the latest version of Vesta. I added the php7 ppa and installed it using this https://www.digitalocean.com/community/ ... untu-14-04.

I was able to get php7 installed and running "php -v" reflects that php7 is installed. When I upload a phpinfo file it still shows php5 is running. Im not sure where to tell apache to use php7 and not php5. Thanks for the help.

Re: PHP 7 and Ubuntu

Posted: Sat May 28, 2016 1:53 am
by mehargags
You Upgraded PHP to PHP7... which means that PHP5 got replaced by PHP7.

Are you running Apache + Nginx as Rev. proxy or Nginx + PHP-FPM ? may be the FPM pkg didn't upgrade in the latter case.

Did you try restarting apache and nginx ? infact I would recommend restarting your server once (if possible) and see if shows php7. Else PM me your SSH details, I'll look into the issue :)

Re: PHP 7 and Ubuntu

Posted: Sat May 28, 2016 3:28 pm
by nickcraig
I am running Apache + Nginx, and I have restarted the server. I guess I just need to tell Apache to use PHP7 instead of PHP5.

Re: PHP 7 and Ubuntu

Posted: Sat May 28, 2016 4:21 pm
by nickcraig
Bingo got it. Run 'a2dismod php5' then run 'a2enmod php7.0'. After restarting Apache2 we are up and running.

Re: PHP 7 and Ubuntu

Posted: Sat May 28, 2016 6:29 pm
by mehargags
Great - pls mark the topic solved

Re: [SOLVED]PHP 7 and Ubuntu

Posted: Wed Jun 08, 2016 8:00 am
by hcjsy
for those who installed php7 and noticed that there websites arent compatable and want to go back to php5, I did the following to go back to php5:
apt-get install ppa-purge
add-apt-repository --remove ppa:ondrej/php
ppa-purge ppa:ondrej/php-7.0
apt-get purge php7.0-common
a2enmod php5