Posted June 29, 2017 Hello everybody, I'm using the Quickbooks Web SDK trying to do a simple invoice query with the example_invoice_query.php file. I keep getting this error: Quote /QuickBooks/Utilities.php/QuickBooks/Driver/Factory.php/QuickBooks/Driver/.phpWarning: require_once(/home/autosim/public_html/quickbooks-php-master/QuickBooks/Driver/.php): failed to open stream: No such file or directory in /home/autosim/public_html/quickbooks-php-master/QuickBooks/Loader.php on line 57Fatal error: require_once(): Failed opening required '/home/autosim/public_html/quickbooks-php-master/QuickBooks/Driver/.php' (include_path='.:/usr/local/lib/php:/home/autosim/automaticsim:/home/autosim/public_html/quickbooks-php-master') in /home/autosim/public_html/quickbooks-php-master/QuickBooks/Loader.php on line 57 Here is my file structure: Here is my Loader file <?php /** * File/class loader for QuickBooks packages * * Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.opensource.org/licenses/eclipse-1.0.php * * @package QuickBooks * @subpackage Loader */ // if (!defined('QUICKBOOKS_LOADER_REQUIREONCE')) { define('QUICKBOOKS_LOADER_REQUIREONCE', true); } if (!defined('QUICKBOOKS_LOADER_AUTOLOADER')) { define('QUICKBOOKS_LOADER_AUTOLOADER', true); } /** * */ class QuickBooks_Loader { /** * */ static public function load($file, $autoload = true) { //print('loading file [' . $file . ']' . "\n"); if ($autoload and QuickBooks_Loader::_autoload()) { return true; } static $loaded = array(); if (isset($loaded[$file])) { return true; } $loaded[$file] = true; if (QUICKBOOKS_LOADER_REQUIREONCE) { echo $file; require_once QUICKBOOKS_BASEDIR . $file; //<------------- Here is line 56 } else { echo $file; require QUICKBOOKS_BASEDIR . $file; } return true; } /** * */ static protected function _autoload() { if (!QUICKBOOKS_LOADER_AUTOLOADER) { return false; } static $done = false; static $auto = false; if (!$done) { $done = true; if (function_exists('spl_autoload_register')) { // Register the autoloader, and return TRUE spl_autoload_register(array( 'QuickBooks_Loader', '__autoload' )); $auto = true; return true; } } return $auto; } /** * */ static public function __autoload($name) { if (substr($name, 0, 10) == 'QuickBooks') { $file = '/' . str_replace('_', DIRECTORY_SEPARATOR, $name) . '.php'; QuickBooks_Loader::load($file, false); } } /** * Import (require_once) a bunch of PHP files from a particular PHP directory * * @param string $dir * @return boolean */ static public function import($dir, $autoload = true) { $dh = opendir(QUICKBOOKS_BASEDIR . $dir); if ($dh) { while (false !== ($file = readdir($dh))) { $tmp = explode('.', $file); if (end($tmp) == 'php' and !is_dir(QUICKBOOKS_BASEDIR . $dir . DIRECTORY_SEPARATOR . $file)) { QuickBooks_Loader::load($dir . DIRECTORY_SEPARATOR . $file, $autoload); //require_once $dir . '/' . $file; } } return closedir($dh); } return false; } } Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted June 29, 2017 Don't you see that slash just before .php extension in require path? You're probably insert one slash to much, try to debug your code to find out where it is happening. Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted June 30, 2017 Did you check permissions? Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted July 5, 2017 Author On 6/29/2017 at 5:07 PM, Mr_KoKa said: Don't you see that slash just before .php extension in require path? You're probably insert one slash to much, try to debug your code to find out where it is happening. I can't figure out where it's coming from... Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted July 6, 2017 Somewhere where you glue things together using dir separators like: $file = '/' . str_replace('_', DIRECTORY_SEPARATOR, $name) . '.php'; or QuickBooks_Loader::load($dir . DIRECTORY_SEPARATOR . $file, $autoload); Try to echo things out and see where it getting wrong. Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now