Debian8 部署 laravel 5.3 (php7.0 + nginx)

來源:互聯網
上載者:User

標籤:

web根目錄:/var/www/html

更換 apt-get 源
cd /etc/apt/sources.list
deb http://ftp.debian.org/debian jessie main contrib non-free
deb http://ftp.debian.org/debian jessie-updates main contrib non-free
deb http://security.debian.org jessie/updates main contrib non-free
deb http://packages.dotdeb.org jessie all
deb http://ftp.debian.org/debian jessie-backports main

更新 apt-get 源
apt-get update

安裝composer
apt-get install composer

建立laravel項目
cd /var/www/html
composer create-project laravel/laravel app --prefer-dist
chmod -R 755 app
cd app
chmod -R 777 bootstrap
chmod -R 777 storage

安裝php7.0
apt-get php php-fpm

安裝nginx
apt-get nginx

編輯php.ini
vim /etc/php/7.0/fpm/php.ini
;cgi.fix_pathinfo=1修改為cgi.fix_pathinfo=0

編輯nginx配置
vim /etc/nginx/sites-enabled/default

server {
    listen 80;
 
    server_name app.com; #你的網域名稱
    root /var/www/html/app/public;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
 
    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }


    location ~ /\.ht {
        deny all;
    }

}



嘿嘿,mysql自行安裝,以及php相關擴充

Debian8 部署 laravel 5.3 (php7.0 + nginx)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.