(Dec 29) New version 0.9.8-18 has been released. More you can find here

[SOLVED]PHP 7 and Ubuntu Topic is solved

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Forum rules
Before creating a new topic or reply on the forum you should fill out additional fields "Os" and "Web" in your profile section.
In case of violation, the topic can be closed or response from the support will not be received.
nickcraig
Posts: 8
Joined: Thu May 26, 2016 7:57 pm

[SOLVED]PHP 7 and Ubuntu

Postby nickcraig » Thu May 26, 2016 8:17 pm

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.
Last edited by nickcraig on Sun May 29, 2016 1:30 am, edited 1 time in total.

nickcraig
Posts: 8
Joined: Thu May 26, 2016 7:57 pm

Re: PHP 7 and Ubuntu

Postby nickcraig » Thu May 26, 2016 9:27 pm

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?

mehargags
Moderators
Posts: 903
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: PHP 7 and Ubuntu

Postby mehargags » Thu May 26, 2016 10:22 pm

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.

nickcraig
Posts: 8
Joined: Thu May 26, 2016 7:57 pm

Re: PHP 7 and Ubuntu

Postby nickcraig » Fri May 27, 2016 2:25 pm

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/tutorials/how-to-upgrade-to-php-7-on-ubuntu-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.

mehargags
Moderators
Posts: 903
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: PHP 7 and Ubuntu

Postby mehargags » Sat May 28, 2016 1:53 am

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 :)

nickcraig
Posts: 8
Joined: Thu May 26, 2016 7:57 pm

Re: PHP 7 and Ubuntu

Postby nickcraig » Sat May 28, 2016 3:28 pm

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.

nickcraig
Posts: 8
Joined: Thu May 26, 2016 7:57 pm

Re: PHP 7 and Ubuntu  Topic is solved

Postby nickcraig » Sat May 28, 2016 4:21 pm

Bingo got it. Run 'a2dismod php5' then run 'a2enmod php7.0'. After restarting Apache2 we are up and running.

mehargags
Moderators
Posts: 903
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: PHP 7 and Ubuntu

Postby mehargags » Sat May 28, 2016 6:29 pm

Great - pls mark the topic solved

hcjsy
Posts: 16
Joined: Tue Jun 07, 2016 3:56 pm

Re: [SOLVED]PHP 7 and Ubuntu

Postby hcjsy » Wed Jun 08, 2016 8:00 am

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


Return to “Web Server”



Who is online

Users browsing this forum: No registered users and 1 guest