Invalid argument supplied for foreach()

Thanks for all the great work you've done with this project. It's great!

I was just wondering about an error I've got a few hundred times in my Errors Log:

Invalid argument supplied for foreach()
/home/userdude/public_html/pics/main.php (Line:3221)

Is there anything I can do to stop this?

Willie Wonka


I checked the code around this. It looks fine. Not sure what is causing all the errors...

//take all groups where the user is a member
//and merge the grants to be easy to check it later if needed
foreach($pa_user["groups"] as $key => $value){
if($where ==""){
$where = $where . "name=='".$key."'";
$where = $where . "|| name=='".$key."'";
[ line 3221 ] foreach($rec as $record){
$pa_grants =array_merge($pa_grants,$record["grants"]);

I'm getting the

I'm getting the same:

Invalid argument supplied for foreach()
\htdocs\pix3\main.php (Line:3221)

Also getting these 2:

unlink(data_pix/.album_sys.php.lock) [function.unlink]: Permission denied
\htdocs\pix3\phpdatabase.php (Line:258)

unlink(data_pix/.album_languages.php.lock) [function.unlink]: No such file or directory
\htdocs\pix3\phpdatabase.php (Line:258)

Error log warning messages

My log file is full of messages like this:
"Invalid argument supplied for foreach()
/home/mhd-01/ (Line:3225)"
Is there some way to get these messagges not be written?

No there is no way to switch

No there is no way to switch it off. Error log will be automaticalle deleted if it is bigger then 2MB. And it takes almost no performance as it is just appending some info on the end of a file.

But you are right, you do not need it if everything is ok, but it is better for me if you ask for support and something is wrong ... May be in the next version i will add "disable" checkbox for error logs.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.