Hide Php error Messages?

Teensweb

New Member
Messages
352
Reaction score
1
Points
0
Can anyone tell me how to hide php's error messages?
I would be thankful if anyone can tell me where I can edit php.ini too!
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
Try using the ini_set() function to set the value of this, you will have to do it every time you run the script though.

This code should turn it off, I warn you that it will probably ignore any code after the error.
PHP:
<?php
ini_set('display_errors', 'off');
?>

I would suggest that you have a look at the error handling functions, because its a much better way of doing this. ;)
http://au.php.net/manual/en/intro.errorfunc.php
 

phpasks

New Member
Messages
145
Reaction score
0
Points
0
Try using the ini_set() function to set the value.

This code turn it off, I warn you that it will probably ignore any code after the error.
<div class="smallfont" style="margin-bottom: 2px;">PHP Code:
PHP:
 	 		 			 <?php 
ini_set('display_errors', '0'); 
ini_set("url_rewriter.tags","");
ob_start();
session_start();
?>
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
Because the php.ini file is for the entire server that you are on, which has thousands of accounts, you cannot change it. You can however use the below code at the beginning of each of your files, which will temporarily change the settings while that script is running, you will have to use it for every script that you want to run.

PHP:
<?php
ini_set('display_errors', 'off');
?>

In your case, it appears that you are missing a file, could you please check that you have the includes/rating_config.php file in the correct location.
 
Last edited:

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
You can't edit php.ini.

Have you tried fixing the errors instead of hiding them? Either comment out the include/require statemaent for that file, or upload the file it wants.
 

Teensweb

New Member
Messages
352
Reaction score
1
Points
0
But my include path is right, i use the 5 star rating system found at http://boedesign.com/2008/02/18/ajax-star-rating/
it works well in my homepage but when it comes to another directory theres some prob!!In fact the rating system works well but its just that message
Edit:
I tried all tour codes but it doesn't work at all!!
 
Last edited:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
Maybe you should try posting the first few lines of the php document with the error.
 

Teensweb

New Member
Messages
352
Reaction score
1
Points
0
Can I have your .htaccess please!!,
because that one produces an internal service error!!!!!!
 
Top