CherryT Posted July 10, 2008 Share Posted July 10, 2008 Ok, so here's the problem: I use a separate PHP file for mySQL database connection information (username, password, and the like), as well as for connecting to the database by simply including a file. The directories are set up similar to this: The directory the script is in: /contentm/install/thescript.php or possibly /www/contentm/install/thescript.php, but the /www/ does not show up on Filezilla's directory listing for my subdomain The directory which the included stuff is located in is: /contentm/SQL/ Now, one would think you would just be able to do: require '../SQL/scripta.php' or die("Error message 1"); but when I execute the script, I get an error message of: Warning: main(1): failed to open stream: No such file or directory in /home/www/rhyok.freehostia.com/RCM/installer/installer_setupsql.php on line 6 Warning: main(1): failed to open stream: No such file or directory in /home/www/rhyok.freehostia.com/RCM/installer/installer_setupsql.php on line 6 Warning: main(1): failed to open stream: No such file or directory in /home/www/rhyok.freehostia.com/RCM/installer/installer_setupsql.php on line 6 Fatal error: main(): Failed opening required '1' (include_path='.') in /home/www/rhyok.freehostia.com/RCM/installer/installer_setupsql.php on line 6 where line 6 is the first require function. Am I doing something wrong here? EDIT: GAAH! I am such a 'tard. You can't use the "...or die();". I'm guessing it's because it's trying to find the directory I entered INCLUDING the "or die();" line. Problem solved. Quote Link to comment Share on other sites More sharing options...
dannyb785 Posted July 10, 2008 Share Posted July 10, 2008 Please mark the topic as SOLVED by looking at the top/bottom of the page for the button that indicates solved Quote Link to comment Share on other sites More sharing options...
discomatt Posted July 10, 2008 Share Posted July 10, 2008 You should be able to use ..or die, but you have to bracket your values... require ('../SQL/scripta.php') or die("Error message 1"); Though the or die in a require is kind of redundant, considering require shoots a fatal error if it fails Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.