nginx搭建php提示No input file specified.

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

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

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!

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

查看所有标签

猜你喜欢:

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

Inside the C++ Object Model

Inside the C++ Object Model

Stanley B. Lippman / Addison-Wesley Professional / 1996-5-13 / USD 64.99

Inside the C++ Object Model focuses on the underlying mechanisms that support object-oriented programming within C++: constructor semantics, temporary generation, support for encapsulation, inheritanc......一起来看看 《Inside the C++ Object Model》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码