• lnmp环境搭建错误集合


    错误1:

      页面显示:No input file specified

      nginx错误日志:FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: open_basedir restriction in effect. File(/data/wwwroot/Luo/public/index.php) is not within the allowed path(s): (/home/wwwroot/default/:/tmp/:/proc/) in Unknown on line 0

      这是由于网站的目录没有权限访问,修改php的配置文件:

      修改php.ini    open_basedir=/home/wwwroot/default/:/tmp/:/proc/:/data/wwwroot/
      然后重启 php-fpm 就可以了

    错误2:

      Warning: scandir() has been disabled for security reasons in /data/wwwroot/

      打开php.ini配置文件,找到这一项:disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen

      去掉里面的scandir 然后保存,重启php-fpm

    错误3:

      502 Bad gateway

      这个原因一般是由于nginx和php配置不一致,nginx和php关联的方式有两种:一种是tcp  也就是http://127.0.0.1:9000进行代理处理php文件;第二种是套接字方式unix:/tmp/php-cgi.sock;

      nginx 和php 采用tcp方式:

        nginx.conf配置:fastcgi_pass   127.0.0.1:9000;

        php-fpm.conf配置:listen = 127.0.0.1:9000

      nginx和php采用套接字:

        nginx.conf配置:fastcgi_pass unix:/tmp/php-cgi.sock;

        php-fpm.conf配置:listen = /tmp/php-cgi.sock

      修改两边配置文件为同一种方式,然后重启php-fpm,重启nginx 

  • 相关阅读:
    4. 变量
    3.进制的转换
    2 java程序入门
    truncate/delete/drop 区别
    sql server查询优化方法(海量数据)
    C#将DataTable转化成数组
    jq获取表格同一行第一列的内容
    C#将时间格式由yyyyMMdd转化成yyyy-MM-dd
    Easyui改变单元格背景颜色和字体颜色
    js判断数组中是否含有某元素(indexOf/includes)
  • 原文地址:https://www.cnblogs.com/myIvan/p/9861070.html
Copyright © 2020-2023  润新知