php errors

The
/var/log/php_errors.log
shows
“[…] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/inc/player_lib.php:295) in /var/www/command/player_wrk.php on line 287”
every few seconds.

System: rpi, volumio 1.1beta, RELEASE DATE: 24-12-2013

Yeah I get the same. It’s a little annoying. :slight_smile: It’s caused by part of the code being slightly incorrect. You can either modify your php.ini to tell it not to produce the logs, or you can periodically run the script in the pi home folder to zero out the logs.

M.

Just as machiavelli said, unfortunately this seems to be a bug in the ever-looping worker file. Till this has been fixed I’ve suppressed the warning messages in the /var/www/command/player_wrk.php file by adding the following statement just before the loop (circa line 286), that is, just before the while statement:

error_reporting(E_ERROR | E_PARSE);

A restart will be needed for the change to have effect.

seems to trace to a problem with cfgdb_read

diff player_wrk.php.orig player_wrk.php

91c94
< wrk_sourcemount($db,'mountall');
---
> wrk_sourcemount($db,'mountall',null);
pi@volumio:/var/www/command$ diff player_wrk.php.orig player_wrk.php
73a74,76
> sysCmd('/usr/bin/aplay /var/lib/mpd/.silence.wav');
> sysCmd('/usr/bin/amixer set PCM 66%');
>
91c94
< wrk_sourcemount($db,'mountall');
---
> wrk_sourcemount($db,'mountall',null);

diff player_lib.php.orig player_lib.php

304c304
<                       $sessionid = playerSession('getsessionid',$db);
---
>                       $sessionid = playerSession('getsessionid',$db,null,null);
312c312
<                               playerSession('storesessionid',$db);
---
>                               playerSession('storesessionid',$db,null,null);
317c317
<               $params = cfgdb_read('cfg_engine',$dbh);
---
>               $params = cfgdb_read('cfg_engine',$dbh,null,null);
367c367
<       $result = cfgdb_read('cfg_engine',$dbh,'sessionid');
---
>       $result = cfgdb_read('cfg_engine',$dbh,'sessionid',null);
384c384
<       if(!isset($param)) {
---
>       if(is_null($param)) {
386c386
<       } else if (isset($id)) {
---
>       } else if (!is_null($id)) {
588c588
< playerSession('open',$db);
---
> playerSession('open',$db,null,null);
648c648
< playerSession('unlock');
---
> playerSession('unlock',null,null,null);
982c982,983
<               $mounts = cfgdb_read('cfg_source',$dbh);
---
>               $mounts = cfgdb_read('cfg_source',$dbh,null,null);
> if (is_array($mounts)) {
987a989,991
> } else {
> $return = 1;
> }
1002c1006
<               $source = cfgdb_read('cfg_source',$dbh);
---
>               $source = cfgdb_read('cfg_source',$dbh,null,null);

with these modifications, only some debug statements remain cat /var/log/php_errors.log

[11-Mar-2014 07:29:02 UTC] >>>>> cfgdb_read(cfg_engine,dbh,sessionid,) >>>>>
SELECT value from cfg_engine WHERE param="sessionid"
[11-Mar-2014 07:29:02 UTC] >>>>> cfgdb_read(cfg_engine,dbh,,) >>>>>
SELECT * from cfg_engine
[11-Mar-2014 07:29:02 UTC] >>>>> cfgdb_read(cfg_source,dbh,,) >>>>>
SELECT * from cfg_source
[11-Mar-2014 07:29:04 UTC] >>>>> cfgdb_read(cfg_engine,dbh,,) >>>>>
SELECT * from cfg_engine
[11-Mar-2014 07:29:04 UTC] >>>>> cfgdb_read(cfg_engine,dbh,sessionid,) >>>>>
SELECT value from cfg_engine WHERE param="sessionid"
[11-Mar-2014 07:29:04 UTC] >>>>> cfgdb_read(cfg_engine,dbh,,) >>>>>
SELECT * from cfg_engine

player_wrk.zip (3.93 KB)
player_lib.zip (9.59 KB)