By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

Command line PHP: suppress warnings?

P: n/a
Hello all.

I have some PHP scripts run by cron that email me all day for no good
reason. The scripts are outputting warnings like:

PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module 'zlib' already loaded in Unknown on line 0
The environment is PHP 5.1.2 (cli) under FreeBSD.

The jobs are called like so:

0,15,30,45 * * * * /usr/local/bin/php -f /www/subsites/whatever/
htdocs/syncher.php

Though I have also tried this using the -q flag instaed of -f.

Any thoughts on suppressing this?

There doesn't seem to be a flag for it here:

http://us2.php.net/manual/en/features.commandline.php

TIA for any help!!!

FvB
Jan 8 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Tue, 08 Jan 2008 19:42:20 +0100, Franz Von Bayros
<kn**************@gmail.comwrote:
Hello all.

I have some PHP scripts run by cron that email me all day for no good
reason. The scripts are outputting warnings like:

PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module 'zlib' already loaded in Unknown on line 0
The environment is PHP 5.1.2 (cli) under FreeBSD.

The jobs are called like so:

0,15,30,45 * * * * /usr/local/bin/php -f /www/subsites/whatever/
htdocs/syncher.php

Though I have also tried this using the -q flag instaed of -f.

Any thoughts on suppressing this?

There doesn't seem to be a flag for it here:

http://us2.php.net/manual/en/features.commandline.php
Why not redirect the errors to /dev/null ? Then again, it's an error which
just should be fixed.
--
Rik Wasmus
Jan 8 '08 #2

P: n/a
On Jan 8, 12:52 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Tue, 08 Jan 2008 19:42:20 +0100, Franz Von Bayros

<knotinmybacky...@gmail.comwrote:
Hello all.
I have some PHP scripts run by cron that email me all day for no good
reason. The scripts are outputting warnings like:
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module 'zlib' already loaded in Unknown on line 0
The environment is PHP 5.1.2 (cli) under FreeBSD.
The jobs are called like so:
0,15,30,45 * * * * /usr/local/bin/php -f /www/subsites/whatever/
htdocs/syncher.php
Though I have also tried this using the -q flag instaed of -f.
Any thoughts on suppressing this?
There doesn't seem to be a flag for it here:
http://us2.php.net/manual/en/features.commandline.php

Why not redirect the errors to /dev/null ? Then again, it's an error which
just should be fixed.
--
Rik Wasmus
Exactly and if the environment changes and there are real errors
instead of this warning noise it would suck if I didn't know.

FvB
Jan 8 '08 #3

P: n/a
Franz Von Bayros wrote:
Hello all.

I have some PHP scripts run by cron that email me all day for no good
reason. The scripts are outputting warnings like:

PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module 'zlib' already loaded in Unknown on line 0
The environment is PHP 5.1.2 (cli) under FreeBSD.

The jobs are called like so:

0,15,30,45 * * * * /usr/local/bin/php -f /www/subsites/whatever/
htdocs/syncher.php

Though I have also tried this using the -q flag instaed of -f.

Any thoughts on suppressing this?

There doesn't seem to be a flag for it here:

http://us2.php.net/manual/en/features.commandline.php

TIA for any help!!!

FvB
I would try to figure out why PHP is attempting to load those extensions
twice. It's always better to fix problems than to suppress their symptoms.

If your PHP setup is like mine (which it may well not be), you might
find that you have multiple php.(conf|ini) files - separate for apache
and cli - and a set of individual extension config files that are shared
between both, located in a php.d (or similar) directory. If the modules
are being loaded in the php.conf file as well as in an individual config
file under php.d, the problem could be corrected by removing the
`extension=XXX.so` lines from the main config file.

Jeremy
Jan 8 '08 #4

P: n/a
In our last episode,
<fd**********************************@41g2000hsy.g ooglegroups.com>,
the lovely and talented Franz Von Bayros
broadcast on comp.lang.php:
Hello all.
I have some PHP scripts run by cron that email me all day for no good
reason. The scripts are outputting warnings like:
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module 'zlib' already loaded in Unknown on line 0
Remove duplicate lines from extensions.ini (un*x) or whatever the equivalent
is in your OS.

--
Lars Eighner <http://larseighner.com/us****@larseighner.com
Countdown: 377 days to go.
Jan 8 '08 #5

P: n/a
NC
On Jan 8, 10:42 am, Franz Von Bayros <knotinmybacky...@gmail.com>
wrote:
>
I have some PHP scripts run by cron that email me all day for no good
reason. The scripts are outputting warnings like:

PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module 'zlib' already loaded in Unknown on line 0

The environment is PHP 5.1.2 (cli) under FreeBSD.

The jobs are called like so:

0,15,30,45 * * * * /usr/local/bin/php -f /www/subsites/whatever/
htdocs/syncher.php

Though I have also tried this using the -q flag instaed of -f.

Any thoughts on suppressing this?
Check out php.ini and any other relevant initialization files you may
have. It looks like extensions are enabled twice.

Best regards,
NC
Jan 9 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.