473,883 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is there anyway to hide php error messages ?

56 New Member
Is there anyway to hide php error messages? Because i have in my php code error but it redirecting after 1 sec and shows my hosting path and php error number, but this error doesn't effect anything.
Dec 10 '09 #1
14 5203
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Are you doing this in your code?

Expand|Select|Wrap|Line Numbers
  1. ini_set("display_errors", 1); 
Dheeraj Joshi
Dec 10 '09 #2
56 New Member
Thanks Mr Dheeraj Joshi , you helped me alot, it's solved, it was great really ,
Dec 10 '09 #3
8,658 Recognized Expert Moderator Expert
it is always better to fix any errors that occur. as already mentioned, you can suppress the display of error messages, but this will get you in trouble, if there is a critical error appearing. additionally, you can catch any ‘error’ below E_ERROR level (i.e. warnings, notices and user defined errors) yourself and preventing them to show up.
Dec 10 '09 #4
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
I will go with Dormlich's suggestion.

Its always good to fix all errors and warning in the code... You just can't predict that the error throwing situation can not occur..... Anyways try to fix the bug.

Dheeraj Joshi
Dec 10 '09 #5
56 New Member
Thanks Guys for replies

i fixed the error but i'm still putting ini_set("displa y_errors", 1);
in my code just to protect hosting path for any error , is this can make any problem ?
Dec 10 '09 #6
8,658 Recognized Expert Moderator Expert
of course, you won’t notice any new errors unless you catch the errors (as possible) beforehand. see also Exceptions*, Error Handling and set_error_handl er()

* - I’d always prefer Exceptions over User Defined Errors
Dec 10 '09 #7
56 New Member
Thanks Mr Dormilich, your reply was useful
Dec 10 '09 #8
1,044 Recognized Expert Top Contributor
ini_set() is a function that alters the settings of your php.ini file for the rest of your script. php.ini is a file that is read and parsed by your server. As such, your server receives all errors from PHP that php.ini sets. This is governed by the "error_reportin g" flags, not the "display_errors " flag.

In other words, even if you don't display the errors, the errors are still saved. In Apache, the error messages are in the apache/logs/errors.log file, in the order in which the occurred (ascending IIRC).
Dec 11 '09 #9
56 New Member
Hi Mr Kovik , Thanks for replay
i was asking for code just to hide the error messages from users because that can show my hosting path
but is the file logs/errors.log can be accessed by anyone else or just me and hosting ?
Dec 11 '09 #10

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

Similar topics

by: lkrubner | last post by:
This is a general computer question, but I'm writing in PHP so I'll post this to comp.lang.php. I've been writing a content management system. I've a Singleton object that keeps track of all errors and stores them in an array. As things work right now, I write out each error message individually. I'm thinking that as the code grows, this system will not continue to scale. Right now my software consists of 1.4 megs of PHP code. I don't...
by: Galina | last post by:
Hello I have created a trigger not to let records with certain fields null to be inserted into the table: BEGIN IF :new.RUL_CODE is null or :new.FES_UINS_CODE is null or :new.FES_UIO_CALOCC is null then RAISE_APPLICATION_ERROR(-20000,'Record is not saved. Check course record and try to save again.'); end if;
by: DataBard007 | last post by:
Hello Access Gurus: I use Win98SE and Access97. I just built a simple Access97 application which holds all contact information for my personal contacts, such as first name, last name, address, city, state, etc. When the user wants to search for a particular record, he does two things: 1. On the form is a text box on which he enters the text he is searching for.
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through VS, however, when I change to release and put it out on the web it fails giving me the following error message The underlying connection was closed. Could not establish a trust relationship with the remote server.
by: tlyczko | last post by:
Hello, I've searched on toggling divs and didn't really find what I was looking for, I saved a bunch of different threads. I have a form with several different text boxes for things like dates, numbers, etc. arranged in a table, each row has the same kind of text boxes for data entry (10 rows probably). I want to have a separate section above the form where I can toggle a div containing an appropriate error message to appear after the...
by: mac | last post by:
Brand Newbie Alert! I am working through the "Build a Program Now!" book by Microsoft Press. The last chapter has a little app that should stay in the system tray when the user clicks on the 'X' to close the form. It should only shutdown when the user chooses an option from the context menu. The book suggests writing code in the FormClosing event of the form "Main" to modify the behavior of the 'X' menu on the form. I have reproduced...
by: lawrence k | last post by:
I've made it habit to check all returns in my code, and usually, on most projects, I'll have an error function that reports error messages to some central location. I recently worked on a project where someone suggested to me I was spending too much time writing error messages, and that I was therefore missing the benefit of using a scripting language. The idea, apparently, is that the PHP interpreter writes all the error messages that are...
by: Paul McGuire | last post by:
Is there any way to hide portions of an exception stack trace? When users get exceptions when using pyparsing, there are usually many layers of pyparsing-internal stack messages that are not at all helpful in diagnosing the problem - the intervening messages just divert the user's attention from the most significant parts of the stack, usually the user's call into my module, and the root exception message. For instance, here is a stack...
by: FutureShock | last post by:
I am using a registration class to process a registration form and need some opinions on returning error messages. I am self referring the page on submit. I would like to send each form field to the class for processing (validating, sanitizing, etc..) So far no problem. Now I am throwing ideas around on how best to check for error messages to the users.
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.