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

in #vincentb7 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

Sort:  

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

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

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 62836.52
ETH 2558.21
USDT 1.00
SBD 2.72