使用lnmp常见问题集锦

常常有人qq里问我php,nginx等安装使用的问题,发现他们都使用了一款叫lnmp的一键安装包,本文就集中列出一些常见的使用问题php

open_basedir

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
  • Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/default/1211/bootstrap/autoload.php) is not within the allowed path(s): (/home/wwwroot/default/1211/public/:/tmp/:/proc/) in /home/wwwroot/default/1211/public/index.php on line 22nginx

  • lnmp安装是自动追加了以上内容到fastcgi.conf, 其做用是限定文件引入等操做只能在root的定义 tmp proc 三个目录下进程, 可有些实际状况是php常常引入本身或者第三方的库文件,并且这些库文件不在root目录下,因此致使程序引入文件报错,可屏蔽此行解决thinkphp

rewrite

location / {
    try_files $uri $uri/ /index.php?$args;
}
  • 对于安装完成上来就部署使用thinkphp这些mvc的项目,请必定要确认你的nginx配置已经对全部请求转发到index.php作的处理,若是没有请修改nginx对应server端并增长以上内容并重启你的nginxbootstrap

更多问题不断增长中

  • 若是有在使用lnmp中遇到什么疑难,请留言或者加入咱们的群
    233415606mvc

相关文章
相关标签/搜索