root@localdomain Posted April 5, 2011 Share Posted April 5, 2011 Hi all, I recently started rewriting some code from an existing open source project. I noticed now, for the second time, that I got errors in a php file(the php file with errors was required_once into the main file) however they were not shown. note however that other errors seem to be shown properly in the browser and are logged. The behavior I get is that the page gets executed, the required page is loaded, and at the point that the statement is reached that is incorrect (for example calling a function that is not declared) it stops silently. Only the part that ran and sent output to the client is shown. Nothing is in the browser or in the logs about the error :S Eventually I found out by using XDebug to step through the code. At a certain function it just stopped. Anyone an idea what is wrong? Quote Link to comment https://forums.phpfreaks.com/topic/232803-some-errors-are-not-shownlogbrowser-just-a-blank-page/ Share on other sites More sharing options...
requinix Posted April 5, 2011 Share Posted April 5, 2011 Find your php.ini and set error_reporting = -1 display_errors = on Then restart the web server and try your code again. Quote Link to comment https://forums.phpfreaks.com/topic/232803-some-errors-are-not-shownlogbrowser-just-a-blank-page/#findComment-1197433 Share on other sites More sharing options...
root@localdomain Posted April 5, 2011 Author Share Posted April 5, 2011 Thanks for your response. I already have these in my config. error_reporting = E_ALL display_errors = On So it should be something else:s Quote Link to comment https://forums.phpfreaks.com/topic/232803-some-errors-are-not-shownlogbrowser-just-a-blank-page/#findComment-1197465 Share on other sites More sharing options...
requinix Posted April 5, 2011 Share Posted April 5, 2011 Also take a look at the page source. Sometimes error messages get hidden because of the HTML or CSS surrounding them. And see that phpinfo() lists the right php.ini settings. Might be that they're overwritten somewhere, or maybe you were looking at the wrong file. There are some kinds of errors that you can't catch. Can't recover from. It's been a while since I've done PHP but I'm pretty sure that calling a non-existant function is one of those. Quote Link to comment https://forums.phpfreaks.com/topic/232803-some-errors-are-not-shownlogbrowser-just-a-blank-page/#findComment-1197472 Share on other sites More sharing options...
root@localdomain Posted April 6, 2011 Author Share Posted April 6, 2011 Also take a look at the page source. Sometimes error messages get hidden because of the HTML or CSS surrounding them. And see that phpinfo() lists the right php.ini settings. Might be that they're overwritten somewhere, or maybe you were looking at the wrong file. There are some kinds of errors that you can't catch. Can't recover from. It's been a while since I've done PHP but I'm pretty sure that calling a non-existant function is one of those. This morning a friend of mine used a simple piece of code. He got errors for non-existing functions that are called in a page that is required-in. Got to look further. I'll try and see if omitting any html output is messing things up. In my friends case he had no issues when using html code. (I only use very basic html to put a form there, and after that html table) I am pretty sure it is the correct page I am using as I changed the configuration to log to /var/log/php.log and normally errors are logged in there. Thanks anyway for your suggestion. I'll post back if I have an update or fix the issue. Quote Link to comment https://forums.phpfreaks.com/topic/232803-some-errors-are-not-shownlogbrowser-just-a-blank-page/#findComment-1197857 Share on other sites More sharing options...
root@localdomain Posted April 6, 2011 Author Share Posted April 6, 2011 I found what was causing the suppression of the error. I was reusing php code from someone else. The require_once function had a @ in front of the line. I googled and found out this suppresses error messages :s So this is fixed Quote Link to comment https://forums.phpfreaks.com/topic/232803-some-errors-are-not-shownlogbrowser-just-a-blank-page/#findComment-1197875 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.