搭建lnmp环境

安装lnmp一键安装包:https://lnmp.org/install.html

相关配置文件

Nginx 配置文件:/usr/local/nginx/conf/nginx.conf

PHP 配置文件: /usr/local/php/etc/php.ini

MySQL配置文件: /etc/my.cnf

默认网站根目录: /home/wwwroot/default

 

搭建常见问题:

composer安装laravel应用报错:

报错1: 403 Foribidden

检查目录所属者是否和/usr/local/nginx/conf/nginx.conf中的用户名一致

报错2:关于PHP的报错

编辑/usr/local/php/etc/php.ini中disable_function 相应的方法即可

该网页无法正常运作

情景:nginx.conf网站更目录更改以后报以上错误

编辑/usr/local/php/etc/php.ini打开错误信息提示

display_errors = On

display_startup_errors = On

修改完重启php-fpm    lnmp php-fpm stop|start 


Warning: require(): open_basedir restriction in effect...

 


错误日志显示,访问脚本不在 open_basedir的限定目录里面,配置open_basedir 一般会在php.ini 或 nginx 配置文件里面

 

error in exception handler: The stream or file"/var/www/laravel/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in/var/www/laravel/bootstrap/compiled.php:8423

 

在应用目录下执行命令

chmod -R 777 storage/

 

posted @ 2019-06-20 22:21  itmsc  阅读(126)  评论(0编辑  收藏  举报