473,395 Members | 1,471 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,395 software developers and data experts.

how to suppress error messages without using error_reporting(0) ?

This line:

if (file_exists($fileName)) {
is (on some web servers) giving me this kind of error:
Warning: SAFE MODE Restriction in effect. The script whose uid is 1022
is not allowed to access /home/www owned by uid 0 in
/home/www/krubner/ppKernel/McControllerForAll.php on line 454
This only happens when the software is checking directories that are
above what where PHP is allowed to check.

I want this software to work on all servers and I don't want the end
user to have to know PHP, and so I don't want them to have to set
error_reporting() on their own. I also feel like I shouldn't have to
do this:

error_reporting(0);

because my software should capture all errors on its own and store all
the error messages that I write in the resultsObject that my software
uses. Turning off error reporting is cheating, in my view, the
programmer should capture all errors on their own.

So how do I suppress errors on a line like this?

if (file_exists($fileName)) {
Jul 17 '05 #1
1 6763
lawrence a écrit le 30/04/2004 :
So how do I suppress errors on a line like this?

if (file_exists($fileName)) {


Use the @ operator before the function call :
if(@file_exists($fileName)) {

See manual for more details :
http://www.php.net/manual/en/languag...rorcontrol.php
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
4
by: lurisia | last post by:
Hi, I'm not getting any error messages for my incorrect php code, and it's making it very difficult to debug. Instead of an error, the page displays part of the generated html (without the part...
9
by: Jani Jalkala | last post by:
I have PHP 4.3.7 running on my client's Windows 2003 server. The same computer also runs SQL Server and I am trying to connect from PHP to a database. This fails, so I would like to track down the...
6
by: Krishna Srinivasan | last post by:
I have a form with check boxes. When accessing a check box element that is not checked, I get a notice (Notice: Undefined variable..). Is there a way to hide these notices and warning in PHP code...
2
by: John Alleyman | last post by:
Hi there, Is there a simple way to prevent error messages (falsely connecting to database etc.) being diplayed? My own build in messages are enough... thanks, Chris
1
by: Sheldon Glickler | last post by:
My system admin turned down all the error levels so that the warnings would not go to the user. Now I find that in dubugging, I don't get messages as to what is wrong. I tried...
7
by: monomaniac21 | last post by:
Hi all! How can you get rid of the error that displays if you do a query which returns no result and then try and fetch the array, WITHOUT having to put the while in another conditional like if...
2
by: ZeeHseez | last post by:
Hi, I have written a webbrowser application in VB .net Framework 1.1. I would like to suppress javascript error messages. However, the silent property of the webbrowser control suppresses the...
9
by: Daniel Smedegaard Buus | last post by:
Hey all :) I was wondering about the $error_types (I particularly notice the 's' suffix when reading the manual) parameter for 'set_error_handler()': Can be used to mask the triggering of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.