PHP Fatal error: Call to a member function read () on a non-object in \ zc_install \
site URL: www.toscanadamare.eu ZC version: 1.5.5 , list of plugins, PHP version 5.6.3,
hi, I am installing the 1.5.5 zen cart version and the installer don't start, this is the error:
PHP Fatal error: Call to a member function read () on a non-object in \ zc_install \ includes \ classes \ class.systemChecker.php on line 600
This is a portion of the class.systemChecker.php file containing the line 600:
594 static function getAdminDirectoryList()
595 {
596 $adminDirectoryList = array();
597
598 $ignoreArray = array('.', '..', 'cache', 'logs', 'installer', 'zc_install', 'includes', 'testFramework', 'editors', 'extras', 'images', 'docs', 'pub', 'email', 'download', 'media');
599 $d = @dir(DIR_FS_ROOT);
600 while (false !== ($entry = $d->read())) {
601 if (is_dir(DIR_FS_ROOT . $entry) && !in_array($entry, $ignoreArray))
602 {
603 if (file_exists(DIR_FS_ROOT . $entry . '/' . 'banner_manager.php'))
604 {
605 $adminDirectoryList[] = $entry;
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
Remove the @ in @dir on line 599 and see what the error is. I suspect it can't obtain a directory listing due to some restrictions in your server's configuration.
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
I removed @ at 599 line and this is the error
PHP Warning: dir(D:\inetpub\webs\toscanadamareeu\,D:\inetpub\webs\toscanadamareeu\): Access is denied. (code: 5) in D:\inetpub\webs\toscanadamareeu\zc_install\includes\classes\class.systemChecker. php on line 599
PHP Warning: dir(D:\inetpub\webs\toscanadamareeu\): failed to open dir: Permission denied in D:\inetpub\webs\toscanadamareeu\zc_install\includes\classes\class.systemChecker. php on line 599
PHP Fatal error: Call to a member function read() on boolean in D:\inetpub\webs\toscanadamareeu\zc_install\includes\classes\class.systemChecker. php on line 600
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
Probably best to report this issue to your hosting company, because they're the ones who control permission for that. They can fix the Access Denied issue.
Most likely your user account doesn't have the usual required permissions to allow scanning the list of files in the directory.
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
I have a similar problem when trying to upgrade to ver 1.5.5 on an IIS server. The root of this problem in my case is, I believe, the DIR_FS_ROOT constant which is derived somehow from the DIR_FS_CATALOG. The logs show this error report:
[27-Jun-2018 17:26:03 America/Los_Angeles] PHP Fatal error: Uncaught Error: Call to a member function read() on boolean in
C:\HostingSpaces\ergonicauser1\ergonica.com\newroot\zc_install\includes\classes\ class.systemChecker.php:607
Stack trace:#0 C:\HostingSpaces\ergonicauser1\ergonica.com\newroot\zc_install\includes\modules\ pages\index\header_php.php(12): systemChecker::getAdminDirectoryList()#1 C:\HostingSpaces\ergonicauser1\ergonica.com\newroot\zc_install\index.php(36): require('C:\\HostingSpace...')#2 {main} thrown in C:\HostingSpaces\ergonicauser1\ergonica.com\newroot\zc_install\includes\classes\ class.systemChecker.php on line 607
In configure.php I define DIR_FS_CATALOG thusly: define('DIR_FS_CATALOG', '/C:/HostingSpaces/ergonicauser1/ergonica.com/newroot/');
In my research it looks like the CATALOG and ROOT should be the same, but I have not been able to find any place in the code where this is defined. Somehow the functions create the DIR_FS_ROOT as ‘C:\\HostingSpace...’ . I have even tried to define it by adding code in the configure.php files, but it doesn’t work. The installation fails because it is looking for a folder that does not exist.
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
Is your DIR_FS_CATALOG really set as define('DIR_FS_CATALOG', '/C:/HostingSpaces/ergonicauser1/ergonica.com/newroot/');? What happens if you remove that leading /?
The \\ characters that you're seeing are due to the fact that you're running on a Windows server, so the forward-slashes in the directory tree are changed to back-slashes, which need to be 'escaped' for use, thus the double-backslash.
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
I have tried to use the configuration without that leading / and the results are the same. Notice that DIR_FS_CATALOG is correctly represented in the error log several times without the escaped slash. Only the DIR_FS_ROOT is escaped for some reason.
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
It would be very helpful if someone can inform us of exactly where in the code the constant FS_DIR_ROOT is defined? As I stated above, this is for version 1.5.5b on an IIS server.
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
That's located on line 29 of /zc_install{renamed}/index.php:
Code:
define('DIR_FS_ROOT', realpath(__DIR__ . '/../') . DIRECTORY_SEPARATOR);
Re: PHP Fatal error: Call to a member function read () on a non-object in \ zc_instal
Quote:
Originally Posted by
lat9
That's located on line 29 of /zc_install{renamed}/index.php:
Code:
define('DIR_FS_ROOT', realpath(__DIR__ . '/../') . DIRECTORY_SEPARATOR);
In my experiments, I've learned that I can substitute 'C:/' for __DIR__ in this case and still get the same error. So with the .'/../' that follows, is this looking for a folder at the higher level that includes the current folder as the root? Please pardon my ignorance.