LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-18-2010, 09:55 AM   #1
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Rep: Reputation: 15
php.ini display_errors = Off NOT respected


I have squirrelmail installed on my webserver. So When I'm checking my mail, I get the following errors (Notices and Warnings):

Code:
Warning: preg_split() expects parameter 4 to be long, string given in /usr/share/squirrelmail/functions/imap_messages.php on line 808

Warning: Invalid argument supplied for foreach() in /usr/share/squirrelmail/functions/mime.php on line 52

Notice: Undefined variable: charset_converted in /usr/share/squirrelmail/functions/mime.php on line 316

Notice: Undefined variable: charset in /usr/share/squirrelmail/functions/mime.php on line 317

Notice: Undefined variable: charset in /usr/share/squirrelmail/functions/mime.php on line 317

Notice: Undefined variable: charset in /usr/share/squirrelmail/functions/mime.php on line 317
Now, I have set these two in php.ini
display_errors = Off
error_reporting = Off

Why am I still seeing these Notices?

I am using latest php version on Centos 5.4. And yes, I have restarted my server after making the above changes in php.ini file. Any idea what's going on?

I thank you in advance and appreciate all your help.
 
Old 03-18-2010, 12:45 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Are you sure you're editing the correct php.ini? What gives:
Code:
php -i|grep php.ini
You can add:
Code:
display_startup_errors = Off
Error_reporting is irrelevant but if you want to turn it off, you should use:
Code:
error_reporting = 0
Note also that you can put all of them in a .htaccess in the top squirrelmail directory (I guess it's /usr/share/squirrelmail). In that case you should use:
Code:
php_flag display_startup_errors off
php_flag display_errors off
php_value error_reporting 0
Regards
 
1 members found this post helpful.
Old 03-18-2010, 02:52 PM   #3
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Original Poster
Rep: Reputation: 15
Bathory... a million thanks to you. I fixed the problem using your .htaccess solution.

php -i|grep php.ini
Code:
Loaded Configuration File => /etc/php.ini
I was using this file. I also tried:

display_errors = Off
error_reporting = Off
error_reporting = 0
display_startup_errors = Off

Although I am very happy that I am not getting those error messages anymore, but I am wondering why turning the above parameters off in /etc/php.ini did not work.
 
Old 03-18-2010, 03:22 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
I am wondering why turning the above parameters off in /etc/php.ini did not work.
I'm also curious. You can create a php page containing phpinfo()
Code:
<?php
phpinfo();
?>
and see if this in fact the correct php.ini that the php module uses and what are the values of these directives.
 
Old 03-18-2010, 05:04 PM   #5
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Original Poster
Rep: Reputation: 15
Hi... the phpinfo reports that local value for display_errors is still on. Where do I change the local value?

I've attached a screenshot of phpinfo output.
Attached Thumbnails
Click image for larger version

Name:	3-18-2010 6-01-39 PM.png
Views:	1197
Size:	22.7 KB
ID:	3074  
 
Old 03-18-2010, 06:02 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
The local value is changed through .htaccess files or from within httpd.conf (and perhaps the other *.conf files included in httpd.conf).
 
Old 03-18-2010, 10:25 PM   #7
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks Thread solved!
 
Old 05-05-2011, 06:44 AM   #8
aosiname
LQ Newbie
 
Registered: May 2011
Location: UK
Posts: 1

Rep: Reputation: 0
Lightbulb

using Centos 5.5 from Go Daddy Virtual Dedicated Server
php.ini display errors is on because i need that for other sites so...

I tried the .htaccess solution, restarted the server and it removed one error - but i had 4 left in squirrelroot/functions/mime.php

so i copied the .htaccess to squirrelroot/functions, restarted server but no difference

so i edited the mime.php and added ini_set("display_errors", 0); to mime.php and that fixed it (to some extent) at least it works

Last edited by aosiname; 05-05-2011 at 06:46 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP won't recognize my Configuration File (php.ini) path kriezo Programming 4 02-14-2008 02:31 AM
php.ini-dist to php.ini lord-fu Programming 10 05-02-2006 05:24 PM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
Upgraded PHP from 4.3.4 to 4.3.10 and now it won't read php.ini gregmcavoy Linux - Software 11 01-22-2005 12:16 PM
php: different mail server from php.ini rayds Programming 0 09-14-2004 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration