Php Notice: Undefine Offset

Getting tons of this notice in my PHP error log:



PHP Notice: Undefined offset: 1 in /home/********/public_html/app/Tygh/Session.php on line 182



Anyone know how serious this is and what can be done about it, if anything?

I'm getting the same now, but on screen??

I can't really see that it's affecting my web site adversely…but errors are errors and should be fixed, right?

It's not really an error but a coding practice notice. Starting with PHP 5.3 they made the engine throw notices if you were trying to reference an index in an object or an array that did not exist. There are two ways to handle it, you can either suppress (not recommended) the code with a @ or wrap the condition around an if loop that uses isset() to check for the index pointer first such as:



if (isset($array['someindex'])) {
call_my_function($array['someindex']); // the notice will now not appear because of the condition above
}




You don't really have to worry about it causing stability issues with the site, it's just nothing more than annoying log noise.

OK. Thanks for clearing that up, extrarius!

OK and this is in session.php?

Yes on line 182, however without an exact version of CS-Cart I cannot provide you with a more complete example on how to correct it.

guy ;) create a php.ini in your xsvxart folder and add memory limit 256M or 512M. this will resolve temporary your issuse.

true problem is that you don’t have enough ram to run all procceses so…increase ;)

i ment guys ;) sorry for typo my galaxy is killing me

tested? with php.ini in a cs cart folder?

[quote name='demeldoo' timestamp='1432201720' post='215225']

tested? with php.ini in a cs cart folder?

[/quote]



Sorry for the delay. Yes, I've just added a php.ini file and increased the memory limit to 256M.



My error_log is 90 MB. Should I delete it and let the cart create a new one? It goes back to January of this year.

you can leave it…it should stop after php.ini creation…recheck

[quote name='kingsleypress' timestamp='1432578613' post='215721']





Sorry for the delay. Yes, I've just added a php.ini file and increased the memory limit to 256M.



My error_log is 90 MB. Should I delete it and let the cart create a new one? It goes back to January of this year.

[/quote]



any news? you can share in the bug tracker…

Yes. I deleted the error_log. Since then, the only message that has been logged is this:



[26-May-2015 07:00:02 Etc/GMT+5] PHP Notice: Undefined index: SCRIPT_FILENAME in /home/account_name_here/public_html/app/addons/seo/func.php on line 955



Don't know what that one's about, but thankful all the other messages have stopped. Thanks for your help!

please provide this here :

http://forum.cs-cart.com/index.php?app=tracker&module=projects§ion=issues&iid=5497&unlockUserAgent=1

[quote name='demeldoo' timestamp='1432724396' post='215991']

please provide this here :

http://forum.cs-cart…lockUserAgent=1

[/quote]



Done