鍍金池/ 問答/PHP  Linux/ 阿里云Ubuntu16.04主機用composer安裝Laravel5.1在LN

阿里云Ubuntu16.04主機用composer安裝Laravel5.1在LNMP環(huán)境下500錯誤怎么解決?

安裝完LNMP一鍵安裝包后,把默認(rèn)的nginx.conf里的root /home/wwwroot/default;改為root /home/wwwroot/blog/public(即laravel項目根文件夾),storage和bootstrap的權(quán)限也給了,大部分地方都按照http://blog.csdn.net/dahuzix/...里的設(shè)置去操作,然而還是沒卵用.

回答
編輯回答
情皺

我是題主,問題已解決,還需要加一步:LNMP 1.4上如果不想用防跨目錄或者修改.user.ini的防跨目錄的目錄還需要將 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; 在該行行前添加 # 或刪除改行,需要重啟nginx。

2017年1月11日 10:12
編輯回答
冷溫柔

我最近也剛好碰到了這個問題,正如樓1說的,因為 lnmp 的防跨目錄設(shè)置導(dǎo)致的。

我自己的辦法是為 laravel 重新復(fù)制個專用的 enable-php.conf 和 fastcgi.conf 文件。

cd /usr/local/nginx/conf
sudo cp enable-php.conf enable-php_domain.conf
sudo cp fastcgi.conf fastcgi_domain.conf

編輯 enable-php_domain.conf 文件里面中的 include fastcgi.conf 名稱為 include fastcgi_domain.conf。

編輯 fastcgi_domain.conf 文件里面中的 fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";中的 $document_root 修改為 laravel 項目的根目錄(不指向 public)。

記錄地址

2018年8月8日 08:32
編輯回答
過客
nginx.conf里面增加下這個配置

server {
   location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
}
2018年3月7日 13:39