After installation I have this errors
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 6
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
When I push to any link I have this error:
Fatal error: Only variables can be passed by reference in /home/inets/www/sho2/library/cache/cache.php on line 7
Can anybody help me?
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 6
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 26
Warning: Invalid argument supplied for foreach() in /home/inets/www/sho2/library/cache/cache.php on line 37
When I push to any link I have this error:
Fatal error: Only variables can be passed by reference in /home/inets/www/sho2/library/cache/cache.php on line 7
Can anybody help me?
I try reinstall - problem still exists.
On cache dir I have perm. 0777
Cache files in this dir created.
If I edit cache.php file in /library/cache/cache.php
In line 6 put cache path -> foreach (glob('home/inets/www/sho2/cache/' . 'cache.*') as $file) {
I have this -> Warning: fopen(home/inets/www/sho2/cache/cache.language.1190280267) [function.fopen]: failed to open stream: No such file or directory in /home/inets/www/sho2/library/cache/cache.php on line 18
In cache dir are file with another filename -> cache.language.1190283614
On cache dir I have perm. 0777
Cache files in this dir created.
If I edit cache.php file in /library/cache/cache.php
In line 6 put cache path -> foreach (glob('home/inets/www/sho2/cache/' . 'cache.*') as $file) {
I have this -> Warning: fopen(home/inets/www/sho2/cache/cache.language.1190280267) [function.fopen]: failed to open stream: No such file or directory in /home/inets/www/sho2/library/cache/cache.php on line 18
In cache dir are file with another filename -> cache.language.1190283614
I found where is a problem:
I have PHP5.0.5 and array function end in PHP5.0.5 not work properly
With this code shop start work.
function __construct() {
foreach (glob(DIR_CACHE . 'cache.*') as $file) {
# NEW CODE #
$var=explode("/",$file);
$var=$var[count($var)-1];
$array = explode('.', $var);
##########
//$array = explode('.', end(explode('/', $file))); //OLD CODE
if ($array[2] < time()) {
unlink($file);
}
}
}
I have PHP5.0.5 and array function end in PHP5.0.5 not work properly

With this code shop start work.
function __construct() {
foreach (glob(DIR_CACHE . 'cache.*') as $file) {
# NEW CODE #
$var=explode("/",$file);
$var=$var[count($var)-1];
$array = explode('.', $var);
##########
//$array = explode('.', end(explode('/', $file))); //OLD CODE
if ($array[2] < time()) {
unlink($file);
}
}
}
At first I install on server with PHP 4 and than I have a error.
At second I install opencart on another server with PHP 5 without any problems.
Problem found in array function -> End
http://lv2.php.net/manual/en/function.end.php
That function dont work on PHP4
Maybe need some libraries installed on server?!
At second I install opencart on another server with PHP 5 without any problems.
Problem found in array function -> End
http://lv2.php.net/manual/en/function.end.php
That function dont work on PHP4
Maybe need some libraries installed on server?!
I have the same problem. After install, these are the messages:
Warning: Invalid argument supplied for foreach() in c:\arquivos de programas\easyphp1-8\www\opencart\include\cache.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at c:\arquivos de programas\easyphp1-8\www\opencart\include\cache.php:10) in c:\arquivos de programas\easyphp1-8\www\opencart\include\session.php on line 16
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\arquivos de programas\easyphp1-8\www\opencart\include\cache.php:10) in c:\arquivos de programas\easyphp1-8\www\opencart\include\session.php on line 22
The website and its functions is working but the messages appear on the top of the page. I went to php.net and check that the function end works in php 4 - the version I am running on my server.
Does anybody knows what should I do to fix this issue? thanks
Warning: Invalid argument supplied for foreach() in c:\arquivos de programas\easyphp1-8\www\opencart\include\cache.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at c:\arquivos de programas\easyphp1-8\www\opencart\include\cache.php:10) in c:\arquivos de programas\easyphp1-8\www\opencart\include\session.php on line 16
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\arquivos de programas\easyphp1-8\www\opencart\include\cache.php:10) in c:\arquivos de programas\easyphp1-8\www\opencart\include\session.php on line 22
The website and its functions is working but the messages appear on the top of the page. I went to php.net and check that the function end works in php 4 - the version I am running on my server.
Does anybody knows what should I do to fix this issue? thanks
hi folks!
there is a BUG
.
Because glob()'ing an empty directory returns false, and so calling foreach (false as $value) will obviously break.
so I recomend you to fix it.
In your_store/library/cache/cache.php
replace function __construct()
there is a BUG

Because glob()'ing an empty directory returns false, and so calling foreach (false as $value) will obviously break.
so I recomend you to fix it.
In your_store/library/cache/cache.php
replace function __construct()
Code: Select all
function __construct() {
/**** OLD CODE *****
foreach (glob(DIR_CACHE . 'cache.*',GLOB_ONLYDIR) as $file) {
$array = explode('.', end(explode('/', $file)));
if ($array[2] < time()) {
unlink($file);
}
}
***** END OD OLD CODE *****/
/**** BETTER (NOT BEST) - BUT WORKING NEW CODE ***/
$files = glob(DIR_CACHE . 'cache.*',GLOB_ONLYDIR) or array();
if ( is_array ( $files ) ) {
foreach ($files as $file) {
$array = explode('.', end(explode('/', $file)));
if ($array[2] < time()) {
unlink($file);
}
}
}
/* ***** END OF NEW CODE ***********************/
}
Last edited by franz on Thu Dec 27, 2007 8:31 am, edited 1 time in total.
i've modified this and the same problem bother me,the host PHP version is : 5.8.8franz wrote: hi folks!
there is a BUG.
Because glob()'ing an empty directory returns false, and so calling foreach (false as $value) will obviously break.
so I recomend you to fix it.
In your_store/library/cache/cache.php
replace function __construct()
Code: Select all
function __construct() { /**** OLD CODE ***** foreach (glob(DIR_CACHE . 'cache.*',GLOB_ONLYDIR) as $file) { $array = explode('.', end(explode('/', $file))); if ($array[2] < time()) { unlink($file); } } ***** END OD OLD CODE *****/ /**** BETTER (NOT BEST) - BUT WORKING NEW CODE ***/ $files = glob(DIR_CACHE . 'cache.*',GLOB_ONLYDIR) or array(); if ( is_array ( $files ) ) { foreach ($files as $file) { $array = explode('.', end(explode('/', $file))); if ($array[2] < time()) { unlink($file); } } } /* ***** END OF NEW CODE ***********************/ }
If you have tried every option possible than you can always adjust your htaccess file by renaming it as .htaccess and adding this line in it:
php_flag display_errors off
Only use this option if the whole webshop works correctly but you only get those anoying warnings.
php_flag display_errors off
Only use this option if the whole webshop works correctly but you only get those anoying warnings.
Who is online
Users browsing this forum: No registered users and 2 guests