jrapin Posted November 2, 2006 Share Posted November 2, 2006 When I use my admin.php page to link to my calendar database, it tells me: Fatal error: Failed opening required 'DB.php' (include_path='/php\pear') in /home/webadmin/kewadin.com/html/calendar/cal_inc.php on line 4The beginning of the code requires the "DM.php" file. It doesn't open and gives the former error message.Here's the PHP code on the Calendar Admin Page in Question:<?phpfunction connect() {ini_set("include_path", "C:\php\pear");require_once("DB.php");$type = "mysql";$username = "caladmin";$password = "caladmin";$host = "localhost";$database = "event_calendar";$dsn = $type . "://" . $username . ":" . $password . "@" . $host . "/" . $database;$dbconn = DB::connect($dsn);errortrap($dbconn);$dbconn->setFetchMode(DB_FETCHMODE_ASSOC);return $dbconn;}//end connectObviously, the error is in line 4 because it can't open the DB file. I believe this is because the path is set to ("include_path", "C:\php\pear"); when in fact the DB.php file is located on the MySQL database. How do I fix this error. What is the correct path for the "php.pear"? Since the file is not on my computer but rather on the FTP site how do I reference this fact so that the pear can be found correctly?Respectfully,MySQL & PHP Student Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 2, 2006 Share Posted November 2, 2006 [quote author=jrapin link=topic=113598.msg461679#msg461679 date=1162476314]Obviously, the error is in line 4 and the PHP can't open the DB file. I believe this is because the path is set to ("include_path", "C:\php\pear"); when in fact the DB.php file is located not on the C Drive, but stored ob the MySQL database. How do I fix this error. Please help.[/quote]I've quoted the portion of your post that makes no sense to me whatsoever. What do you mean, [i]the file is stored in the MySQL database[/i]? Is it stored as a BLOB in the database itself? If so, you can't use an include() statement on the file, but rather, you'll have to make a connection to the MySQL database and pull the file out that way. The problem is, it seems like you are attempting to include your database connection, so you'd be running in circles.Yes, it appears that the include_path you are specifying is what's throwing you off, but without knowing a little more about your structure, it's going to be hard to help you fix it. Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 2, 2006 Share Posted November 2, 2006 Side Note: I've also removed the poll since it really has no relevance to the problem at hand. 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.