How to upgrade from PHP 5 to PHP 7.0 on Ubuntu 14.04 with nginx 1.4.6

in vincentb •  7 years ago 

Few steps I have done to upgrade to PHP 7.0

$ sudo service nginx stop
$ sudo apt-get purge php5-*
$ sudo add-apt-repository ppa:ondrej/php-7.0
$ sudo apt-get update
$ sudo apt-get install php7.0 php7.0-common php7.0-cgi php7.0-fpm php7.0-mysql

Edit your site config:

$ sudo nano /etc/nginx/sites-available/default

Example:

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /var/laravel.dev/public;
index index.php index.html index.htm;

server_name laravel;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
    include                  fastcgi_params;
    fastcgi_keep_conn on;
    fastcgi_index            index.php;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_intercept_errors on;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}

}

Start your nginx:

$ sudo service nginx start

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

the vincentb effect
upvoted, commented, and followed
please do the same

https://steemit.com/vincentb/@crob/try-this-vincentb-taggers