Suppressing PHP Warnings from CLI
Suppressing PHP Warnings from CLI
am 22.01.2008 16:27:59 von jerrygarciuh
Hello,
I have a couple of PHP scripts I use via cron and from the CLI. They
always produce 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
I have read all of the commandline flags docs and there does not
appear to be a flag to silence these warnings.
I currently call the scripts like so:
/usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
null
or
/usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
null
Any advice?
TIA!!
JG
Re: Suppressing PHP Warnings from CLI
am 22.01.2008 16:29:42 von zeldorblat
On Jan 22, 10:27 am, jerrygarciuh wrote:
> Hello,
>
> I have a couple of PHP scripts I use via cron and from the CLI. They
> always produce 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
>
> I have read all of the commandline flags docs and there does not
> appear to be a flag to silence these warnings.
>
> I currently call the scripts like so:
>
> /usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> null
>
> or
>
> /usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> null
>
> Any advice?
>
> TIA!!
>
> JG
Why not fix your PHP installation so those warnings don't happen?
It's always better to fix the problem rather than cover up the symptom.
Re: Suppressing PHP Warnings from CLI
am 22.01.2008 16:54:34 von jerrygarciuh
On Jan 22, 9:29 am, ZeldorBlat wrote:
> On Jan 22, 10:27 am, jerrygarciuh wrote:
>
>
>
> > Hello,
>
> > I have a couple of PHP scripts I use via cron and from the CLI. They
> > always produce 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
>
> > I have read all of the commandline flags docs and there does not
> > appear to be a flag to silence these warnings.
>
> > I currently call the scripts like so:
>
> > /usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> > null
>
> > or
>
> > /usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> > null
>
> > Any advice?
>
> > TIA!!
>
> > JG
>
> Why not fix your PHP installation so those warnings don't happen?
> It's always better to fix the problem rather than cover up the symptom.
Thanks for the reply. Why do you assume I have root? I don't have
the ability to alter the PHP install on this server.
JG
Re: Suppressing PHP Warnings from CLI
am 22.01.2008 17:56:17 von jerrygarciuh
On Jan 22, 9:29 am, ZeldorBlat wrote:
> On Jan 22, 10:27 am, jerrygarciuh wrote:
>
>
>
> > Hello,
>
> > I have a couple of PHP scripts I use via cron and from the CLI. They
> > always produce 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
>
> > I have read all of the commandline flags docs and there does not
> > appear to be a flag to silence these warnings.
>
> > I currently call the scripts like so:
>
> > /usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> > null
>
> > or
>
> > /usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> > null
>
> > Any advice?
>
> > TIA!!
>
> > JG
>
> Why not fix your PHP installation so those warnings don't happen?
> It's always better to fix the problem rather than cover up the symptom.
Thanks for the reply. Why do you assume I have root? I don't have
the ability to alter the PHP install on this server.
JG
Re: Suppressing PHP Warnings from CLI
am 22.01.2008 19:48:34 von AnrDaemon
Greetings, jerrygarciuh.
In reply to Your message dated Tuesday, January 22, 2008, 18:27:59,
> I have a couple of PHP scripts I use via cron and from the CLI. They
> always produce 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
> I have read all of the commandline flags docs and there does not
> appear to be a flag to silence these warnings.
Why not fix Your scripts instead?
--
Sincerely Yours, AnrDaemon
Re: Suppressing PHP Warnings from CLI
am 22.01.2008 20:05:12 von Jerry Stuckle
jerrygarciuh wrote:
> On Jan 22, 9:29 am, ZeldorBlat wrote:
>> On Jan 22, 10:27 am, jerrygarciuh wrote:
>>
>>
>>
>>> Hello,
>>> I have a couple of PHP scripts I use via cron and from the CLI. They
>>> always produce 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
>>> I have read all of the commandline flags docs and there does not
>>> appear to be a flag to silence these warnings.
>>> I currently call the scripts like so:
>>> /usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
>>> null
>>> or
>>> /usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
>>> null
>>> Any advice?
>>> TIA!!
>>> JG
>> Why not fix your PHP installation so those warnings don't happen?
>> It's always better to fix the problem rather than cover up the symptom.
>
> Thanks for the reply. Why do you assume I have root? I don't have
> the ability to alter the PHP install on this server.
>
> JG
>
>
Then you need to get whomever set it up to fix the problem.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Suppressing PHP Warnings from CLI
am 22.01.2008 22:20:38 von jerrygarciuh
On Jan 22, 12:48 pm, AnrDaemon wrote:
> Greetings, jerrygarciuh.
> In reply to Your message dated Tuesday, January 22, 2008, 18:27:59,
>
> > I have a couple of PHP scripts I use via cron and from the CLI. They
> > always produce 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
> > I have read all of the commandline flags docs and there does not
> > appear to be a flag to silence these warnings.
>
> Why not fix Your scripts instead?
>
> --
> Sincerely Yours, AnrDaemon
The following script exhibits this problem. How would you suggest I
fix it?
#!/usr/local/bin/php
// nothing to see here
?>
Re: Suppressing PHP Warnings from CLI
am 22.01.2008 22:22:03 von jerrygarciuh
On Jan 22, 1:05 pm, Jerry Stuckle wrote:
> jerrygarciuh wrote:
> > On Jan 22, 9:29 am, ZeldorBlat wrote:
> >> On Jan 22, 10:27 am, jerrygarciuh wrote:
>
> >>> Hello,
> >>> I have a couple of PHP scripts I use via cron and from the CLI. They
> >>> always produce 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
> >>> I have read all of the commandline flags docs and there does not
> >>> appear to be a flag to silence these warnings.
> >>> I currently call the scripts like so:
> >>> /usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> >>> null
> >>> or
> >>> /usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
> >>> null
> >>> Any advice?
> >>> TIA!!
> >>> JG
> >> Why not fix your PHP installation so those warnings don't happen?
> >> It's always better to fix the problem rather than cover up the symptom.
>
> > Thanks for the reply. Why do you assume I have root? I don't have
> > the ability to alter the PHP install on this server.
>
> > JG
>
> Then you need to get whomever set it up to fix the problem.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
So your response is that I cannot programmatically suppress these
messages? Yes?
JG
Re: Suppressing PHP Warnings from CLI
am 23.01.2008 00:37:23 von luiheidsgoeroe
On Tue, 22 Jan 2008 16:54:34 +0100, jerrygarciuh
wrote:
> On Jan 22, 9:29 am, ZeldorBlat wrote:
>> On Jan 22, 10:27 am, jerrygarciuh wrote:
>> > Hello,
>>
>> > I have a couple of PHP scripts I use via cron and from the CLI. They
>> > always produce 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
>>
>> > I have read all of the commandline flags docs and there does not
>> > appear to be a flag to silence these warnings.
>>
>> > I currently call the scripts like so:
>>
>> > /usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
>> > null
>>
>> > or
>>
>> > /usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
>> > null
>>
>> Why not fix your PHP installation so those warnings don't happen?
>> It's always better to fix the problem rather than cover up the symptom.
>
> Thanks for the reply. Why do you assume I have root? I don't have
> the ability to alter the PHP install on this server.
Then tell the one who does to fix it. Especially on a server apparantly
run by someone else (do you pay for that?) one may expect some
professionalism & error-less setup.
On a side note:
command > /dev/null 2>&1
command &> /dev/null
--
Rik Wasmus
Re: Suppressing PHP Warnings from CLI
am 23.01.2008 01:15:21 von Jerry Stuckle
jerrygarciuh wrote:
> On Jan 22, 1:05 pm, Jerry Stuckle wrote:
>> jerrygarciuh wrote:
>>> On Jan 22, 9:29 am, ZeldorBlat wrote:
>>>> On Jan 22, 10:27 am, jerrygarciuh wrote:
>>>>> Hello,
>>>>> I have a couple of PHP scripts I use via cron and from the CLI. They
>>>>> always produce 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
>>>>> I have read all of the commandline flags docs and there does not
>>>>> appear to be a flag to silence these warnings.
>>>>> I currently call the scripts like so:
>>>>> /usr/local/bin/php -f /www/subsites/foo/htdocs/bar/baz.php >> /dev/
>>>>> null
>>>>> or
>>>>> /usr/local/bin/php -q /www/subsites/foo/htdocs/bar/baz.php >> /dev/
>>>>> null
>>>>> Any advice?
>>>>> TIA!!
>>>>> JG
>>>> Why not fix your PHP installation so those warnings don't happen?
>>>> It's always better to fix the problem rather than cover up the symptom.
>>> Thanks for the reply. Why do you assume I have root? I don't have
>>> the ability to alter the PHP install on this server.
>>> JG
>> Then you need to get whomever set it up to fix the problem.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
>
> So your response is that I cannot programmatically suppress these
> messages? Yes?
>
> JG
>
Nope. You can't.
Fix the problem. Don't try to hide it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
=================
Re: Suppressing PHP Warnings from CLI
am 23.01.2008 01:16:23 von Jerry Stuckle
jerrygarciuh wrote:
> On Jan 22, 12:48 pm, AnrDaemon wrote:
>> Greetings, jerrygarciuh.
>> In reply to Your message dated Tuesday, January 22, 2008, 18:27:59,
>>
>>> I have a couple of PHP scripts I use via cron and from the CLI. They
>>> always produce 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
>>> I have read all of the commandline flags docs and there does not
>>> appear to be a flag to silence these warnings.
>> Why not fix Your scripts instead?
>>
>> --
>> Sincerely Yours, AnrDaemon
>
>
> The following script exhibits this problem. How would you suggest I
> fix it?
>
> #!/usr/local/bin/php
>
> // nothing to see here
> ?>
>
As Rik said - get the admin to fix the problem. If you're paying for
hosting, you should expect at least a clean interface.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Suppressing PHP Warnings from CLI
am 23.01.2008 19:56:47 von Franz Von Bayros
On Jan 22, 6:16 pm, Jerry Stuckle wrote:
> jerrygarciuhwrote:
> > On Jan 22, 12:48 pm, AnrDaemon wrote:
> >> Greetings,jerrygarciuh.
> >> In reply to Your message dated Tuesday, January 22, 2008, 18:27:59,
>
> >>> I have a couple of PHP scripts I use via cron and from the CLI. They
> >>> always produce 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
> >>> I have read all of the commandline flags docs and there does not
> >>> appear to be a flag to silence these warnings.
> >> Why not fix Your scripts instead?
>
> >> --
> >> Sincerely Yours, AnrDaemon
>
> > The following script exhibits this problem. How would you suggest I
> > fix it?
>
> > #!/usr/local/bin/php
> >
> > // nothing to see here
> > ?>
>
> As Rik said - get the admin to fix the problem. If you're paying for
> hosting, you should expect at least a clean interface.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
Gotcha, thank you for the replies!
JG