Page 1 of 1
Many PHP errors logged
PostPosted: 03 Sep 2011, 19:01
by BKim
I recently updated to PHP 5.3.8 and I keep seeing these 3 messages in the error log over and over:
- Code: Select all
2011/09/03 18:23:38 [error] 7695#0: *535533 FastCGI sent in stderr: "PHP Notice: Undefined index: typing in /home/user/domain.com/arrowchat/receive/receive_core.php on line 165
PHP Notice: Undefined index: not_typing in /home/user/domain.com/arrowchat/receive/receive_core.php on line 167
PHP Notice: Undefined index: tab_alert in /home/user/domain.com/arrowchat/receive/receive_core.php on line 309" while reading response header from upstream, client: 24.22.243.87, server: www.domain.com, request: "GET /arrowchat/receive/receive_core.php?ah=eM2Ve5Ut1VjZQLBzifmO&hb=5&lp=1&ai=1&cr=-1&no=0&callback=jQuery15103767265997842044_1315099371129&_=1315099372561 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "www.domain.com", referrer: "http://www.domain.com/forum.php"
Curiously Arrowchat seems to be working fine otherwise, but it is filling up the error log pretty quick. Any ideas on what might be causing this?
PostPosted: 03 Sep 2011, 19:27
by Jason
Not a concern in terms of ArrowChat working, but it is fixed in v1.1. To fix it now, you have to check if the session exists before checking if the session is an array on those lines.
PostPosted: 04 Sep 2011, 01:13
by BKim
Hey Jason,
Thanks for another fast response. With the info I supplied I changed the following:
- Code: Select all
if (!is_array($_SESSION['typing']))
$_SESSION['typing'] = array();
if (!is_array($_SESSION['not_typing']))
$_SESSION['not_typing'] = array();
- Code: Select all
if ( isset($_SESSION['typing']) && !is_array($_SESSION['typing']))
$_SESSION['typing'] = array();
if ( isset($_SESSION['not_typing']) && !is_array($_SESSION['not_typing']))
$_SESSION['not_typing'] = array();
I'm not sure if that was the correct way to do it, but everything seems to be working without any errors now. Hope that helps anyone else having the same issue.
PostPosted: 04 Sep 2011, 01:54
by BKim
Hah guess I spoke too soon. It's really mad about line 193 now.
- Code: Select all
foreach ($_SESSION['typing'] as $index => $val) {
Not sure how to tackle this one.
- Code: Select all
PHP Warning: Invalid argument supplied for foreach() in /home/user/domain.com/arrowchat/receive/receive_core.php on line 193
PHP Notice: Undefined index: typing in /home/user/domain.com/arrowchat/receive/receive_core.php on line 193
PostPosted: 04 Sep 2011, 02:01
by BKim
Odd, it won't let me edit the post.
- Code: Select all
PHP Notice: Undefined index: typing in /home/user/domain.com/arrowchat/receive/receive_core.php on line 199
PHP Warning: in_array() expects parameter 2 to be array, null given in /home/user/domain.com/arrowchat/receive/receive_core.php on line 199
PHP Notice: Undefined index: not_typing in /home/user/domain.com/arrowchat/receive/receive_core.php on line 204
PHP Warning: Invalid argument supplied for foreach() in /home/user/domain.com/arrowchat/receive/receive_core.php on line 204
PHP Warning: Invalid argument supplied for foreach() in /home/user/domain.com/arrowchat/receive/receive_core.php on line 193
PHP Notice: Undefined index: typing in /home/user/domain.com/arrowchat/receive/receive_core.php on line 193
- Code: Select all
193: foreach ($_SESSION['typing'] as $index => $val) {
199: if (!in_array($typing_ids[0], $_SESSION['typing'])) {
204: foreach ($_SESSION['not_typing'] as $index => $val) {
PostPosted: 04 Sep 2011, 02:41
by Jason
Revert back to the old file.
Add this:
- Code: Select all
if (!isset($_SESSION['notifications']))
$_SESSION['notifications'] = array();
if (!isset($_SESSION['tab_alert']))
$_SESSION['tab_alert'] = array();
if (!isset($_SESSION['typing']))
$_SESSION['typing'] = array();
if (!isset($_SESSION['not_typing']))
$_SESSION['not_typing'] = array();
if (!isset($_SESSION['notifytime']))
$_SESSION['notifytime'] = 0;
if (!isset($_SESSION['announcetime']))
$_SESSION['announcetime'] = 0;
Directly above this:
- Code: Select all
updateUserSession();
PostPosted: 04 Sep 2011, 17:02
by BKim
Hey again,
Thanks, that seems to have cleared up everything. Curious though did you update the 1.0.6 package? I downloaded it and copied receive_core.php back to my server and found the lines you told me to add already in there.
PostPosted: 05 Sep 2011, 10:20
by KSmith
Apparently v1.0.6 has had this change in place for quite some time. My installed version already has these, and I downloaded back in July.
If the developers want to further clean up the error_log, there are a few other error generating areas that need similar attention:
PHP Notice: Undefined index: chatroom_mess_ids in *****/arrowchat/receive/receive_core.php on line 256
PHP Notice: Undefined index: HTTP_USER_AGENT in *****/arrowchat/includes/functions_mobile.php on line 9
Same in external.php line 56
PHP Notice: Undefined index: HTTP_ACCEPT in *****/arrowchat/includes/functions_mobile.php on line 10
PHP Notice: Undefined index: type in *****/arrowchat/external.php on line 14
Thanks!
PostPosted: 05 Sep 2011, 11:35
by Jason
KSmith wrote:Apparently v1.0.6 has had this change in place for quite some time. My installed version already has these, and I downloaded back in July.
If the developers want to further clean up the error_log, there are a few other error generating areas that need similar attention:
PHP Notice: Undefined index: chatroom_mess_ids in *****/arrowchat/receive/receive_core.php on line 256
PHP Notice: Undefined index: HTTP_USER_AGENT in *****/arrowchat/includes/functions_mobile.php on line 9
Same in external.php line 56
PHP Notice: Undefined index: HTTP_ACCEPT in *****/arrowchat/includes/functions_mobile.php on line 10
PHP Notice: Undefined index: type in *****/arrowchat/external.php on line 14
Thanks!
Thanks for the tips, I just fixed them in the 1.1 package.
Topic Closed
PostPosted: 07 Nov 2012, 12:40
by Staff Bot
This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.