Jump to content

Cannot use a scalar value as an array


Recommended Posts

Hi I create a new post as the one that is on the forum is from 2017 problem:

[Mon May 06 15:42:29.001228 2019] [proxy_fcgi:error] [pid 20020] [client 127.0.0.1:33532] AH01071: Got error 'PHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\n'

[Mon May 06 15:38:11.556735 2019] [proxy_fcgi:error] [pid 19901] [client 127.0.0.1:33332] AH01071: Got error 'PHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\n', referer: https://domain/admin-dir/index.php?controller=AdminModules&token=1b282cf70da3757bec718b32b59d4338&configure=ps_facetedsearch&tab_module=front_office_features&module_name=ps_facetedsearch

[Wed May 08 12:13:07.482461 2019] [proxy_fcgi:error] [pid 19396:tid 140350068848384] [client x.x.x.x:44736] AH01071: Got error 'PHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\n'


[Wed May 08 12:13:32.898469 2019] [proxy_fcgi:error] [pid 19396:tid 140350052062976] [client x.x.x.x:59428] AH01071: Got error 'PHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\nPHP message: PHP Warning:  Cannot use a scalar value as an array in /opt/bitnami/apache2/htdocs/domain/classes/cache/Cache.php on line 463\n'


is prestashop 1.7.5.1, this is going off since we activate PHP-FPM

Link to comment
Share on other sites

Try to delete all cache content in folder /var/cache/ (all folders and files inside)

Then clear cache in Advanced parameters > Performances to clear all others cache.

If errors reappear, try to disabled last cache option (APC) entirely

 

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

Hola,

Gracias por responder.

Es Apache en mi caso, 

Prestashop 1.7.6.2

PHP 7.2.26

FastCGI

 

Tengo un modulo que me genera R_TOO_MANY_REDIRECTS en el enlace de CRON. 

Pero esto si activo el CacheAPC, Si lo desactivo todo en orden. 

 

Saludos. 

 

  • Like 1
Link to comment
Share on other sites

Hi,

I still have this problem.

The following error is constantly recorded in the log. (In plesk)

Warning (MY IP) mod_fcgid: stderr: PHP Warning: Cannot use a scalar value as an array in /var/www/vhosts/ MY DOMAIN /httpdocs/classes/cache/Cache.php on line 463

In cache.php 463 there is the following code:

     

  if (isset($this->sql_tables_cached[$table][$key])) {
                        $this->sql_tables_cached[$table][$key]['count'] += $count;
                        $changedTables[$table] = true;
                    }
                }
            }
        }

 


What can be? 😕 

Thank you. 

Regards

Link to comment
Share on other sites

  • 1 year later...

Hello,

If you have this error : "PHP Warning: Cannot use a scalar value as an array in classes/cache/Cache.php on line 463" then you can replace this :

if (isset($this->sql_tables_cached[$table][$key])) {

with this :

if (isset($this->sql_tables_cached[$table][$key]) && is_array($this->sql_tables_cached[$table][$key])) {

Regards

Link to comment
Share on other sites

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...