nginx搭建php提示No input file specified.

栏目: PHP · 发布时间: 6年前

内容简介:在其原因在于再次访问网站则不会再提示

centos7.6 服务器中搭建 lnmp(linux+nginx+mysql+php7) 部署 thinkphp , 访问时提示: No input file specified.

其原因在于 php fastcgi限制nginx访问目录 ,此时有两种解决方法:

方法一: 修改php.ini配置

  1. 修改 php.ini 文件 open_basedir 参数,开放其项目路径

    vim /etc/php.ini
  2. 假如项目存放在 /opt/project1 , /opt/project2 ,那么更改 open_basedir (如果没有则新增):
    open_basedir = /opt/:/tmp/;
  3. 重启 php-fpm
    service php-fpm restart

方法二: 修改fastcgi.conf

  1. 打开 fastcgi.conf
    vim /etc/nginx/fastcgi.conf
  2. 设置 fastcgi 的可操作目录(防止跨站),在最后添加:

    fastcgi_param PHP_VALUE open_basedir=/opt/:/tmp/;
  3. 重启 nginx
    service nginx restart

再次访问网站则不会再提示 No input file specified.

happy coding!

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

TED Talks Storytelling: 23 Storytelling Techniques from the Best

TED Talks Storytelling: 23 Storytelling Techniques from the Best

Akash Karia / CreateSpace Independent Publishing Platform / 2015-1-11 / USD 6.99

"Every speaker can put these ideas into practice immediately -- and they should!" ~ Dr. Richard C. Harris, Certified World Class Speaking Coach "An insightful read" ~Dennis Waller, Top 500 Revie......一起来看看 《TED Talks Storytelling: 23 Storytelling Techniques from the Best》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具