Skip to content

Instantly share code, notes, and snippets.

@skngetich
Created January 14, 2020 09:22
Show Gist options
  • Select an option

  • Save skngetich/bd51a2d352a11f588a9ce0bd04858e81 to your computer and use it in GitHub Desktop.

Select an option

Save skngetich/bd51a2d352a11f588a9ce0bd04858e81 to your computer and use it in GitHub Desktop.

Revisions

  1. skngetich created this gist Jan 14, 2020.
    23 changes: 23 additions & 0 deletions nginx php ubuntu
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #install PHP 7

    sudo apt-get install software-properties-common -y
    sudo add-apt-repository ppa:ondrej/php -y
    sudo apt-get update
    sudo apt-get install php7.2 php7.2-fpm php7.2-mbstring php7.2-mysql php7.2-curl -y
    sudo service php7.2-fpm restart

    #Configure Nginx with php-fpm
    sudo nano /etc/nginx/sites-available/default

    Add index.php before index.html and after the index directive.

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

    location ~ \.php$ {
    include snippets/fastcgi-php.conf;

    With php7.0-cgi alone:
    fastcgi_pass 127.0.0.1:9000;
    With php7.0-fpm:
    fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }