error-reporting

PHP not displaying errors - Internal Server Error (500)

不想你离开。 提交于 2019-12-03 10:02:41
I've set up a fresh install of Ubuntu Server 12.04 LTS on Amazon AWS with *Apache2/MySQL/PHP5. When I run a PHP script and it encounters an error I don't see any error reporting from PHP, all I see is HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request. I have checked my /etc/php5/apache2/php.ini file and as far as I can tell error reporting should be set up. The contents of the file (regarding errors) are: ; display_errors ; Default Value: On ; Development Value: On ; Production Value: Off ; display_startup

How to turn off mysql errors from being displayed to screen in CodeIgniter

北战南征 提交于 2019-12-03 08:26:05
问题 Even though error_reporting is set to 0, database errors are still being printed to screen. Is there a setting somewhere I can change to disable database error reporting? This is for CodeIgniter v1.6.x EDIT : Re: Fixing errors - Um, yes. I want to fix the errors. I get error notices from my error log, not from what my visitors see printed to their screen. That helps no one, and hurts my system's security. EDIT 2 : Setting error_reporting to 0 does not affect CodeIgniter's built-in error

Exception reporting from a WPF Application

天涯浪子 提交于 2019-12-03 03:07:49
So lets say I happen to have an unhandled exception in my application or it crashes for some reason. Is there some way for me to capture the output and show an error report dialog when the application crashes. What I'm thinking is having a small program running in the background, which only job is to listen for an abnormal exit of the main application and then show the 'report' dialog where the user could choose to email me the output of the error. Not really sure how to implement this, or if this is the right way to do it. Reporting the error message would be an easy task, but I have no idea

mysqli_fetch_assoc() expects parameter / Call to a member function bind_param() errors. How to get the actual mysql error and fix it?

主宰稳场 提交于 2019-12-02 18:24:49
问题 In my local/development environment, the MySQLi query is performing OK. However, when I upload it on my web host environment, I get this error: Fatal error: Call to a member function bind_param() on a non-object in... Here is the code: global $mysqli; $stmt = $mysqli->prepare("SELECT id, description FROM tbl_page_answer_category WHERE cur_own_id = ?"); $stmt->bind_param('i', $cur_id); $stmt->execute(); $stmt->bind_result($uid, $desc); To check my query, I tried to execute the query via

mysqli_fetch_assoc() expects parameter / Call to a member function bind_param() errors. How to get the actual mysql error and fix it?

夙愿已清 提交于 2019-12-02 11:34:59
In my local/development environment, the MySQLi query is performing OK. However, when I upload it on my web host environment, I get this error: Fatal error: Call to a member function bind_param() on a non-object in... Here is the code: global $mysqli; $stmt = $mysqli->prepare("SELECT id, description FROM tbl_page_answer_category WHERE cur_own_id = ?"); $stmt->bind_param('i', $cur_id); $stmt->execute(); $stmt->bind_result($uid, $desc); To check my query, I tried to execute the query via control panel phpMyAdmin and the result is OK. Sometimes your mysqli code produces an error like mysqli_fetch

header() error not shown in php

人盡茶涼 提交于 2019-12-02 09:40:35
I wrote a PHP program, I use session_start() and header() functions, I know I should use this functions before I sending anything to client. it's ok, but for test I send a test message to client with echo "test"; before using header(), but I didn't get any error and header function work without any problem ! In previous versions of PHP at this time I will got a message like : Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:22) in /some/file.php on line 60 I wan't to know why I didn't get any error message ?! My php version is 5.3.1 and

error reporting on specific folders

。_饼干妹妹 提交于 2019-12-02 06:06:19
问题 is there a way to set error_reporting(E_ALL); for a specific directory rather than including it in each file? I'd like to turn on error reporting for my beta.mysite.com 回答1: You can use a .htaccess file in Apache. Just add this line: php_value error_reporting 6143 Or for old PHP versions: php_value error_reporting 2047 Note that you can't use the contants (like E_ALL) From the manual: Note: PHP Constants outside of PHP Using PHP Constants outside of PHP, like in httpd.conf, will have no

PHP won't show any errors

六眼飞鱼酱① 提交于 2019-12-02 01:34:37
问题 Here is my code: echo 'foo'; error_reporting(E_ALL); echo 'this line doesnt end in a semi colon' echo 'i should get an error here'; When I run this I get no error. Not sure how this can be? 回答1: ini_set('display_errors', 1); Do note though that if you do this in the file that has the syntax error, it won't work, as it'll never get executed then. You can also set this true in php.ini (not recommended for production servers), or if you use Apache, in .htaccess with: php_flag display_errors 1

error reporting on specific folders

喜你入骨 提交于 2019-12-02 00:39:36
is there a way to set error_reporting(E_ALL); for a specific directory rather than including it in each file? I'd like to turn on error reporting for my beta.mysite.com Greg You can use a .htaccess file in Apache . Just add this line: php_value error_reporting 6143 Or for old PHP versions: php_value error_reporting 2047 Note that you can't use the contants (like E_ALL) From the manual : Note: PHP Constants outside of PHP Using PHP Constants outside of PHP, like in httpd.conf, will have no useful meaning so in such cases the integer values are required. And since error levels will be added over

PHP won't show any errors

ぃ、小莉子 提交于 2019-12-01 21:19:47
Here is my code: echo 'foo'; error_reporting(E_ALL); echo 'this line doesnt end in a semi colon' echo 'i should get an error here'; When I run this I get no error. Not sure how this can be? ini_set('display_errors', 1); Do note though that if you do this in the file that has the syntax error, it won't work, as it'll never get executed then. You can also set this true in php.ini (not recommended for production servers), or if you use Apache, in .htaccess with: php_flag display_errors 1 error_reporting directive won't help you to show error messages on-screen. It's responsible for which error to