473,388 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Unable to turn off notice errors in php 5.3.2

49
I recently migrated to PHP 5.3.2, and realized that I am unable to turn off notice errors in my site now. I went to php.ini, and in these lines:

Expand|Select|Wrap|Line Numbers
  1. ; Common Values:
  2. ;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
  3. ;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
  4. ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
  5. ;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
  6. ; Default Value: E_ALL & ~E_NOTICE
  7. ; Development Value: E_ALL | E_STRICT
  8. ; Production Value: E_ALL & ~E_DEPRECATED
  9. ; http://php.net/error-reporting
  10. error_reporting = E_ALL & ~E_NOTICE
  11.  
...I've tried setting everything (and I restart apache each time), but I am unable to get rid of notices.

The only way I'm able to get rid of notice errors is by setting :

Expand|Select|Wrap|Line Numbers
  1. display_errors = Off
  2.  
That is, of course, not something I can do since I need to see errors to fix them, and I would like to see errors on the webpage that I coding rather than log them somewhere.

Can someone help? Is this a bug in PHP 5.3.2 or something I am doing wrong?

Thank you very much for your time!

P. S. Also, how can I get PHP 5.3.2 to support the .php3 extension?
Apr 23 '10 #1
6 6154
Atli
5,058 Expert 4TB
Hey.

Are you sure you are editing the correct php.ini? I've often faced similar situations, to find I am editing the wrong config file.

The "E_ALL & ~E_NOTICE" setting should show all error except notices and standard warnings. If you can't get this to work via the php.ini file, try adding a line like this to the top of your script. See if it works:
Expand|Select|Wrap|Line Numbers
  1. error_reporting(E_ALL & ~E_NOTICE);
This should do the same thing.

Also, how can I get PHP 5.3.2 to support the .php3 extension?
That is not related to the PHP configuration, but rather your HTTP server configuration.

In Apache, to make extensions trigger the PHP module, you would add a line to the httpd.conf file that reads something like:
Expand|Select|Wrap|Line Numbers
  1. AddType application/x-httpd-php5 .php .php3 .phtml
This line makes the .php, .php3 and .phtml extensions trigger the PHP module. You can specify whatever extensions you want.
Apr 23 '10 #2
knkk
49
Thanks very much for the quick response, Atli. I am indeed editing the correct file since:

1. When I set display_errors = Off in the php.ini, all error notifications stop, and
2. phpinfo shows the same path as that of the file that I am editing

Unortunately, adding the line at the top of my script did not work, either...
Apr 23 '10 #3
Markus
6,050 Expert 4TB
I'd file a bug at http://bugs.php.net
Apr 23 '10 #4
Atli
5,058 Expert 4TB
What is the value for "error_reporting" in your phpinfo output?

I've been testing this myself, and I can't seem to get any value working for the error_reporting directive in my php.ini file. Doesn't matter what I set it to, I always get "no value" and all errors are disabled. - I can, however, use the error_reporting() function to set it to whatever I need.

I've been playing with this all morning, and nothing seems to work. Even rebooted a few times, just to be sure.

I'm using PHP 5.3.2 (the Ubuntu 10.04 package) on Apache 2.2.

P.S.
If you go ahead and file a bug, please link it here. I'd like to keep an eye on this (and avoid filing a duplicate myself). Thanks.
Apr 24 '10 #5
Atli
5,058 Expert 4TB
Ignore my last. Problem was with the php.ini file itself. There were some trash chars corrupting it... and it only took like 6 hours to figure out xD

(Note to self: when debugging stuff like this, use a fresh copy of the recommended php.ini!)
Apr 24 '10 #6
knkk
49
Okay, I figured what was going wrong. I set error_reporting in my code, which was overwriting the php.ini error_reporting.

Now the reason that that same stuff was working until I upgraded to PHP 5.3.2 was this - in my code, I set the error_reporting command:

Expand|Select|Wrap|Line Numbers
  1. error_reporting(6143);
I should've set it as:
Expand|Select|Wrap|Line Numbers
  1. error_reporting(E_ALL ^ E_NOTICE);
I'm guessing the meaning of 6143 is different in PHP 5.3.2 compared to in 4.1 (or whatever my earlier version was).

As for the php3 extension, it was to be set in the /etc/httpd/conf.d/php.conf file:
Expand|Select|Wrap|Line Numbers
  1. AddHandler php5-script .php .php3
  2. AddType text/html .php
Thank you, Atli, for your suggestions!
Apr 25 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Wayno | last post by:
Hoping someone can help me out with this problem. First problem, is I am unable to view my php error log. In my php.ini I have my log in /var/www/logs/php_error_log. However, it has remained empty....
1
by: jtsree | last post by:
I am Using (Windows XP) Visual Studio.net 2003 professional edition working on VB.net language. I am bulding a very very simple project in VB.net where i connect to Access Database by dragging...
4
by: Brad | last post by:
Error when opening a solution with a web services project in it: "Unable to open the Web project 'myproj'. The file path 'c:\code\myservice' does not correspond to the URL...
0
by: Steve - DND | last post by:
We are continually receiving timeout, and "Unable to write data to the transport connection" errors while using the System.Net.HttpWebRequest class from an ASP.Net web page. Below are the two...
3
by: DJTN | last post by:
I'm getting the following error when I try to compile my setup project in VS 2002. I have re-installed the .net framework 1.1 and it didnt solve the problem. WARNING: Unable to find dependency...
5
by: Joăo Santa Bárbara | last post by:
hi there i have this error in VS2005 DEV Edition "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information." i have create an windows...
3
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net...
3
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice:...
3
by: pyro169 | last post by:
Hey I am making a tic tac toe game, im new to javascript, and when i make the game with 'buttons' and 'x' and 'o' it works perfectly, but i also made some pics and i can get the pics to show up, but...
11
by: Jeff | last post by:
I turned on errors in php: ini_set('display_errors','1'); And I got a slew of notices and a couple of warnings. The notices are mostly missing indexes from doing things like this: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.