PHP-PHP调用文件报错,用的是相对路径,路径是对的
今天将一个文件整个从一个服务器个转移到另一个服务器中去,结果运行时就出现这种提示了。
原服务器中运行正常,没有报错。
PHP Warning: include_once(./sina/sinadown.php): failed to open stream: No such file or directory in /opt/app/SinaWeb/down/GetdocEvent.php on line 3
Warning: include_once(./sina/sinadown.php): failed to open stream: No such file or directory in /opt/app/SinaWeb/down/GetdocEvent.php on line 3
PHP Warning: include_once(): Failed opening './sina/sinadown.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /opt/app/SinaWeb/down/GetdocEvent.php on line 3
Warning: include_once(): Failed opening './sina/sinadown.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /opt/app/SinaWeb/down/GetdocEvent.php on line 3
PHP Warning: include_once(./include/writelog.php): failed to open stream: No such file or directory in /opt/app/SinaWeb/down/GetdocEvent.php on line 4
Warning: include_once(./include/writelog.php): failed to open stream: No such file or directory in /opt/app/SinaWeb/down/GetdocEvent.php on line 4
PHP Warning: include_once(): Failed opening './include/writelog.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /opt/app/SinaWeb/down/GetdocEvent.php on line 4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
nginx 配置节点中,nginx.conf server 节点的 root 有个指向根目录的东西,你如果是.(点),它好像默认就是在那个文件夹在拼接上路径查找。
检查一下你的新服务器上文件的权限够不够
对文件的读写执行权限
请试试:
include_once(dirname(__FILE__).'/include/writelog.php');