News:

AbanteCart v1.4.2 is released.

Main Menu
support

Installaion Error

Started by buyandsell, February 14, 2014, 01:45:38 PM

Previous topic - Next topic

buyandsell

 I have tried to install the abantecart but found some error of configuration
section. with this text.

Sorry, but error occurred during installation:
OK: {"ret_code":50}
Name  Info
2::warning
Invalid argument supplied for foreach() in
......../public_html/core/lib/cache.php on line 52


Anybody help me in this regards.
I am waiting
Thanks

abolabo

is folder "system" and its subfolders are writable ?

abantecart

Did you pass installation validation screen on first step? How and where do you install abantecart?

smallfish

I also have this problem at installation screen step 3.

=======================
Sorry, but error occurred during installation:
OK: {"ret_code":50}
Name   Info
2::warning
Invalid argument supplied for foreach() in /var/www/core/lib/cache.php on line 52
=======================

I am using Debian 7.02 server with PHP-FPM Php 5.3.28

abolabo

is folder system/cache writable?
try to replace file core/lib/cache.php by attached.


smallfish

Yes! It is writeable.

But I have added this line. ( if(is_array($cache_files)) { )
It seems that the function glob() can't return the value (array) to the $cache_files.

It works for me to add the line : if(is_array($cache_files)) {

Thank you!

     public function __construct() {
      $this->registry = Registry::getInstance ();
      $cache_files = glob( DIR_CACHE. '*/*', GLOB_NOSORT);
      if(is_array($cache_files)) {
      foreach ($cache_files as $file) {
         //first of all check if file expired. delete it if needed
         $file_time = filemtime($file);
         if ( (time() - $file_time) > $this->expire ) {
            if (file_exists($file)) {
               unlink($file);
               continue;
            }
         }
         //build cache map as array {cache_file_name_without_timestamp=>expire_time}
         $ch_base = substr($file,0,-11);
         $this->cache_map[$ch_base] = $file_time + $this->expire;
      }
      }
     }

abolabo

yes. cause is glob function result. But i can not to understand why it returns false. Can't to reproduce.. can you help me with that?

smallfish

Quote from: abolabo on February 19, 2014, 06:09:29 AM
yes. cause is glob function result. But i can not to understand why it returns false. Can't to reproduce.. can you help me with that?

How can I help?

smallfish

#8
It seems that I have fixed the problem by removing character "*' in the following line.

modify    $cache_files = glob( DIR_CACHE. '*/*', GLOB_NOSORT);

to
   $cache_files = glob( DIR_CACHE. '/*', GLOB_NOSORT);

It works now.

Besides, after I have installed abantecart successfully. I also have found that there is missing "?>" in the /system/config.php file.
Please also fix it.


abolabo

Quote from: smallfish on February 19, 2014, 06:32:00 AM
It seems that I have fixed the problem by removing character "*' in the following line.

modify    $cache_files = glob( DIR_CACHE. '*/*', GLOB_NOSORT);

to
   $cache_files = glob( DIR_CACHE. '/*', GLOB_NOSORT);

It works now.

Besides, after I have installed abantecart successfully. I also have found that there is missing "?>" in the /system/config.php file.
Please also fix it.

thank you a lot!

regarding closing tag.
Note:

The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include or require, so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.



Forum Rules Code of conduct
AbanteCart.com 2010 -