小工具知识网

当前位置: 首页 > 行业知识 > 使用lnmp环境部署laravel框架需要注意的点

行业知识

使用lnmp环境部署laravel框架需要注意的点

2026-11-06 11:41:26 来源:互联网转载

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

上一篇:尚易邮件怎么撤回?

下一篇:轻松下载蛋仔游戏,苹果版指南!