繁体   English   中英

PHP:导入文件时出错,无论我使用哪个路径:absolute /“ dotDOTslash”,我都会收到一条错误消息,指出该文件不存在,但确实存在,wtf?

[英]php: error importing file, no matter which path i use: absolute/“dotDOTslash”, i get an error saying the file doesn't exist, but it does exist, wtf?

好的,正如问题所言:我正在将文件包含在文件中,但是我不断收到“无此文件或目录”错误。 对我来说这真的没有意义,因为我已经检查了它们,检查了它们的权限,并且它们与我可以包含在其他脚本中的相同

请注意:这些包​​含是由另一个文件中包含的文件完成的

即:login.php-包括-check_login.php(产生这些错误的文件)

这是我目前的包括:

include('/home/user/public_html/taxnetwork.co.za/main/db/select_all.php');
require_once('input_cleaner.php');
include('/home/user/public_html/taxnetwork.co.za/main/db/insert.php');
require_once('/home/user/public_html/taxnetwork.co.za/main/mail/mailer.php');

这些是我得到的错误:

Warning: require_once(./db/insert.php) [function.require-once]: failed to open stream: No such file or directory in /home/user/public_html/taxnetwork.co.za/main/mail/mailer.php on line 2

Fatal error: require_once() [function.require]: Failed opening required './db/insert.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/taxnetwork.co.za/main/mail/mailer.php on line 2

如警告说-你有问题

/home/user/public_html/taxnetwork.co.za/main/mail/mailer.php on line 2

然后查看一下,您将看到require_once(./db/insert.php)可以将其更改为:

require_once('/home/user/public_html/taxnetwork.co.za/main/db/insert.php')

或者 :

require_once(realpath(dirname(__FILE__).'/../../').'/db/insert.php')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM