内容简介:在其原因在于再次访问网站则不会再提示
在 centos7.6
服务器中搭建 lnmp(linux+nginx+mysql+php7)
部署 thinkphp
, 访问时提示: No input file specified.
其原因在于 php fastcgi限制nginx访问目录 ,此时有两种解决方法:
方法一: 修改php.ini配置
-
修改
php.ini文件open_basedir参数,开放其项目路径vim /etc/php.ini
-
假如项目存放在
/opt/project1,/opt/project2,那么更改open_basedir(如果没有则新增):open_basedir = /opt/:/tmp/;
-
重启
php-fpmservice php-fpm restart
方法二: 修改fastcgi.conf
-
打开
fastcgi.confvim /etc/nginx/fastcgi.conf
-
设置
fastcgi的可操作目录(防止跨站),在最后添加:fastcgi_param PHP_VALUE open_basedir=/opt/:/tmp/;
-
重启
nginxservice nginx restart
再次访问网站则不会再提示 No input file specified.
happy coding!
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
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》 这本书的介绍吧!