support

Author Topic: Installaion Error  (Read 15349 times)

Offline buyandsell

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Installaion Error
« on: February 14, 2014, 01:45:38 PM »
 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

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2067
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Installaion Error
« Reply #1 on: February 17, 2014, 04:11:11 AM »
is folder "system" and its subfolders are writable ?
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4363
  • Karma: +301/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Installaion Error
« Reply #2 on: February 17, 2014, 05:36:37 PM »
Did you pass installation validation screen on first step? How and where do you install abantecart?
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
Re: Installaion Error
« Reply #3 on: February 19, 2014, 02:59:52 AM »
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

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2067
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Installaion Error
« Reply #4 on: February 19, 2014, 04:38:55 AM »
is folder system/cache writable?
try to replace file core/lib/cache.php by attached.

“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
Re: Installaion Error
« Reply #5 on: February 19, 2014, 05:59:52 AM »
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;
      }
      }
     }

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2067
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Installaion Error
« Reply #6 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?
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
Re: Installaion Error
« Reply #7 on: February 19, 2014, 06:27:30 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?

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
Re: Installaion Error
« Reply #8 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.

« Last Edit: February 19, 2014, 06:35:17 AM by smallfish »

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2067
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Installaion Error
« Reply #9 on: February 19, 2014, 06:43:11 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.


“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod