russia5 Posted October 5, 2016 Share Posted October 5, 2016 (edited) I can not find why my pear directory is failing. DB.php which is in the pear directory does not open. I have pasted code to show the path of the server to the secondary website(see the red below for the code and the output). The path that I can see is: /home1/nuclearp/public_html/libs/pear/DB.php Thanks to anyone who can see why I am getting my error. This is the index.php //this script reads the path and is listed in the output below: <?php $path = getcwd(); echo "This Is Your Absolute Path: "; echo $path; ?> <?php require_once("includes/ru_config.php"); require_once("includes/ru_connection.php"); require_once("includes/ru_data.php"); require_once("includes/ru_utils.php"); require_once("libs/ru_multi_smarty.php"); $smarty->display("index.tpl"); ?>This is ru_config.php <?php //require_once(dirname(__FILE__) . 'ru_4pear.php'); ini_set("include_path", ini_get("include_path") . ":/home1/nuclearp/public_html/libs/pear/"); require_once('DB.php'); This is the output from www.atc-roofing.com (the index.php result) This Is Your Absolute Path: /home1/nuclearp/public_html/atc-roofing.com Warning: require_once(DB.php): failed to open stream: No such file or directory in /home1/nuclearp/public_html/atc-roofing.com/includes/ru_connection.php on line 4 Fatal error: require_once(): Failed opening required 'DB.php' (include_path='.:/opt/php54/lib/php:/home1/nuclearp/public_html/libs/pear/') in /home1/nuclearp/public_html/atc-roofing.com/includes/ru_connection.phpon line 4 Edited October 5, 2016 by requinix it was all sorts of messed up Quote Link to comment https://forums.phpfreaks.com/topic/302282-connection-to-pear-lib-problem/ Share on other sites More sharing options...
requinix Posted October 5, 2016 Share Posted October 5, 2016 Does require_once('/home1/nuclearp/public_html/libs/pear/DB.php');work? Quote Link to comment https://forums.phpfreaks.com/topic/302282-connection-to-pear-lib-problem/#findComment-1538034 Share on other sites More sharing options...
russia5 Posted October 5, 2016 Author Share Posted October 5, 2016 I added the DB.php and I took the : out of the code, as you suggested, and I got the following output: This Is Your Absolute Path: /home1/nuclearp/public_html/atc-roofing.com Warning: require_once(DB.php): failed to open stream: No such file or directory in /home1/nuclearp/public_html/atc-roofing.com/includes/ru_connection.php on line 4Fatal error: require_once(): Failed opening required 'DB.php' (include_path='.:/opt/php54/lib/php:/home1/nuclearp/public_html/libs/pear/DB.php') in /home1/nuclearp/public_html/atc-roofing.com/includes/ru_connection.php on line 4 Quote Link to comment https://forums.phpfreaks.com/topic/302282-connection-to-pear-lib-problem/#findComment-1538039 Share on other sites More sharing options...
requinix Posted October 5, 2016 Share Posted October 5, 2016 No, don't change the include path. Just replace that one require_once you had with the one I posted. So <?php //require_once(dirname(__FILE__) . 'ru_4pear.php'); ini_set("include_path", ini_get("include_path") . ":/home1/nuclearp/public_html/libs/pear/"); require_once('/home1/nuclearp/public_html/libs/pear/DB.php');The point is to see whether the file can be included successfully at all. Quote Link to comment https://forums.phpfreaks.com/topic/302282-connection-to-pear-lib-problem/#findComment-1538046 Share on other sites More sharing options...
russia5 Posted October 5, 2016 Author Share Posted October 5, 2016 Troubleshooting this problem, I shorten it up a bit with: require_once('/home1/nuclearp/public_html/libs/pear/DB.php');I I got the following error This Is Your Absolute Path: /home1/nuclearp/public_html/atc-roofing.com Warning: require_once(/home1/nuclearp/public_html/libs/pear/DB.php): failed to open stream: No such file or directory in /home1/nuclearp/public_html/atc-roofing.com/includes/ru_connection.php on line 6 Fatal error: require_once(): Failed opening required '/home1/nuclearp/public_html/libs/pear/DB.php' (include_path='.:/opt/php54/lib/php') in /home1/nuclearp/public_html/atc-roofing.com/includes/ru_connection.phpon line 6 The code I pasted in this response is on line 6. I checked the folders and DB.php is in the correct place: home1/nuclearp/public_html/libs/pear/DB.php Can you see the error. And thanks, I very much appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/302282-connection-to-pear-lib-problem/#findComment-1538062 Share on other sites More sharing options...
Jacques1 Posted October 5, 2016 Share Posted October 5, 2016 Sounds like a permission problem. Are you sure that the Unix account of the webserver (usually something like www-data) has execute permissions for every single directory of the path and read permissions for the script? Quote Link to comment https://forums.phpfreaks.com/topic/302282-connection-to-pear-lib-problem/#findComment-1538064 Share on other sites More sharing options...
russia5 Posted October 6, 2016 Author Share Posted October 6, 2016 I figured the problem. This is an alternative domain i.e.) public_html/atc-roofing.com/xxx I did not have acc-roofing.com folder included into the path. I did put in acc-roofing/ into it but I still got the error so I took it out. After lots and lots of studying it, and with your help in telling me that there was absolutly something wrong with the path, then I caught it. I owe you a lot of gratitude. Thans so much!!! Greg Quote Link to comment https://forums.phpfreaks.com/topic/302282-connection-to-pear-lib-problem/#findComment-1538079 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.