简体   繁体   中英

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?

okay so as the question says: i'm including files in a file, but i keep getting "no such file or directory" errors. and it really doesn't make sense to me, because i've checked them, i've checked their permissions and they're the same as those that i can include in other scripts

just so you know: these includes are being made by a file that is being included within another

ie: login.php - includes - check_login.php (which is the file that yields these errors)

here are my current includes:

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');

and these are the errors i'm getting:

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

as warning say - you have the problem in

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

then look in it and you will see there require_once(./db/insert.php) you can change it to:

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

or to :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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