How to install PHP7 in *Unix

Asked

Viewed 804 times

1

I decided to test a Unix-like system (Linux Mint) to learn more, and I need to install PHP7, because the Phptherightway sent. I already installed apache2 via Terminal and Mysql. I know there is a way to install PHP7 via terminal, but according to this guy here, has not yet an official release. So I went there on http://php.net/ and downloaded this package here PHP7. There’s a file there install, I read, but did not understand how to install such a package via terminal. someone with experience with this could help me?

1 answer

1

In the Ubuntu terminal:

$ sudo add-apt-repository ppa:ondrej/php -y
$ sudo apt-get update
$ sudo apt-get install -y php7.0-fpm php7.0-mysql php7.0-curl php7.0-mcrypt php7.0-gd

NOTE: The above code will install PHP FPM, ideal for Nginx or Apache worker. If you are using Apache prefork + mod_php, use:

$ sudo apt-get install -y php7.0 php7.0-mysql php7.0-curl php7.0-mcrypt php7.0-gd

Already includes the Curl, Mysql, Mcrypt and GD libraries. There is a more detailed explanation in this link: https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04

  • In my case gave the error Impossible to find the package php7.0, you know what can be? Use Ubuntu 15.04

  • @fernandoandrade is sure that you added the repository and then gave a update?

  • Yes @Gabriel S. it appears with the $ apt-cache policy 500 http://ppa.launchpad.net/ondrej/php/ubuntu/ Vivid/main Translation-en 500 http://ppa.launchpad.net/ondrej/php/ubuntu/ Vivid/main i386 Packages release v=15.04,o=LP-PPA-Ondrej-php,a=Vivid,n=Vivid,l=PPA for co-installable PHP 5.6 + 7.0,c=main origin ppa.launchpad.net

  • 1

    @fernandoandrade According to this answer (http://stackoverflow.com/a/35766715/1161005), it appears that PHP packages have been removed from the ppa:Ondrej/php repository for Ubuntu version 15.04. Upgrading to version 15.10 should solve this problem (but I recommend upgrading to version 16.04 with a clean installation)

  • True, better update. Vlw @Gabriel S.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.