Use of undefined constant and variable

Hello all,

Again, not sure if it’s a bug or what but I’m seeing a bunch of errors in /var/log/apache2/error.log
File is at more than 50MB for the past 24 hrs.

PHP Notice: Use of undefined constant en_GB - assumed ‘en_GB’ in /srv/rutorrent/home/inc/localize.php on line 4
PHP Notice: Use of undefined constant UTF - assumed ‘UTF’ in /srv/rutorrent/home/inc/localize.php on line 4
PHP Notice: Use of undefined constant eth0 - assumed ‘eth0’ in /srv/rutorrent/home/widgets/bw_tables.php on line 4
PHP Notice: Undefined variable: master in /srv/rutorrent/home/widgets/ram_stats.php on line 355
PHP Notice: Undefined variable: username in /srv/rutorrent/home/widgets/ram_stats.php on line 355
PHP Warning: session_destroy(): Trying to destroy uninitialized session in /srv/rutorrent/home/inc/config.php on line 2
PHP Notice: Undefined variable: style in /srv/rutorrent/home/widgets/bw_tables.php on line 184
PHP Notice: Undefined variable: style in /srv/rutorrent/home/widgets/bw_tables.php on line 200
PHP Notice: Undefined variable: summary in /srv/rutorrent/home/widgets/bw_tables.php on line 79
PHP Notice: Undefined variable: summary in /srv/rutorrent/home/widgets/bw_tables.php on line 80
PHP Notice: Undefined variable: day in /srv/rutorrent/home/widgets/bw_tables.php on line 88
PHP Notice: Use of undefined constant eth0 - assumed ‘eth0’ in /srv/rutorrent/home/widgets/data.php on line 2

Also:
ls: cannot access ‘/home/*****/.sessions/.torrent’: No such file or directory

Thank you for your help.

Those errors are normal…the ls error is also in the log? I’m not familiar with that one.

Hello RXWatcher,

Yep the “ls” error is in the error.log of the apache2 directory.

Thanks

Hi there guys,

Just performed a fresh installation of QuickBox (Ubuntu 16.04) and keep on getting exactly the same errors. My error log is growing steadily. Tried turning off PHP notice or fixing the files in question - that didn’t really help. Maybe you had a chance to look into this?

Thanks!

These are all normal php errors. Is your dashboard/installation functioning properly, or are you receiving errors in any other applications?

Hi,

Dashboard is working fine, haven’t noticed any errors produced there (though I can’t get Plex to start working, though it is another topic). I am looking for a way to reduce the output of those errors, otherwise I feel that the files will grow significantly with no way of controlling it. Could you please tell me how can I disable PHP notice output in Apache log files?

Thanks in advance!

Sure, you can safely delete logs therein by doing the following:

cd /var/log
rm -rf apache2/*

You could additionally write a cron script that will remove files older than (x) amount of days with something such as the following.

[1] Create a bash script to place in /usr/local/bin. We’ll call it apachelog_clean.

nano /usr/local/bin/apachelog_clean

Within this file, enter the contents:

#!/bin/bash

find /var/log/apache2/* -mtime +3 -type f -delete

This will remove files in that directory that are older than 3 days

Now make the script executable with:

chmod +x /usr/local/bin/apachelog_clean

[2] Now setup your cron to fire this script on a schedule of your choosing.

crontab -e

Within your crontab enter the following cron job:

0 10 * * * /usr/local/bin/apachelog_clean

This will run the script daily at 10AM server time.


Note: You may have to issue a restart to apache to get your logs rotating once more. Do so with service apache2 restart



By default Ubuntu uses logrotate Take a look at your /etc/logrotate.d/apache2 file with
nano /etc/logrotate.d/apache2 , you’ll probably find that is has a line like the following:

rotate 14

This means it will keep 14 copies of your rotated log files. Change this number to the number you want to keep.

1 Like

Hi,

That’s great, thanks for the instructions. Will use this!

Cheers!

1 Like