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!

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

查看所有标签

猜你喜欢:

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

Learn Python 3 the Hard Way

Learn Python 3 the Hard Way

Zed A. Shaw / Addison / 2017-7-7 / USD 30.74

You Will Learn Python 3! Zed Shaw has perfected the world’s best system for learning Python 3. Follow it and you will succeed—just like the millions of beginners Zed has taught to date! You bring t......一起来看看 《Learn Python 3 the Hard Way》 这本书的介绍吧!

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

RGB HEX 互转工具

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

各进制数互转换器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具