1,上傳項目文件后,需要chmod -R 777 storage授予文件權限,不然會報錯file_put_contents(/): failed to open stream: Permission denied。
如果后面還是報錯沒有權限的話,就執行ps -ef |grep php查詢php運行用戶。然后執行chown -R www.www storage/
2,nginx的fastcgi.conf文件將其$document_root
變量修改為項目目錄,不然會報錯Warning: require(): open_basedir restriction in effect.?
3,nginx.conf還需要配置相關信息才能訪問得到laravel網站,具體配置查詢laravel中文文檔就有。
4,設置storage軟鏈接:php artisan storage:link
如果報錯:symlink() has been disabled for security reasons
找到 php.ini (/usr/local/php/etc)文件,在 disable_functions 配置中刪掉 symlink(及其前面或后面的任意一個逗號) 。
再去項目根目錄下執行php artisan storage:link