Dave123 Posted January 20, 2008 Share Posted January 20, 2008 Hello there I am trying to figure out why PHP is not showing any error in the browser window even though i set it to error_reporting(ALL) and display_error=on. Is there any other configuration setting do i need to look into php.in. Your help is appreciated. I have got one more question which is really strange error. While connecting to mysql server. Mysql client connects to sever with my username and password, but when i connect to server with same username and password through phpmyadmin it gives me an error saying access violation so i had to make my default setting for mysql i.e. no password. This works fine with both mysql client and PHPmyadmin. Now there are two questions raised. your help will be appreciated.. Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/ Share on other sites More sharing options...
revraz Posted January 20, 2008 Share Posted January 20, 2008 phpmyadmin doesn't use the same login info. Is this a webhost you pay for or your own? Also, in regards to your first question, maybe there are no errors to report? Did you check the error log? Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444381 Share on other sites More sharing options...
Dave123 Posted January 20, 2008 Author Share Posted January 20, 2008 Thanks for the reply... I did check the error log..it shows for following script. the script is <?php err_log(); echo "Really Bad ...."; Log Error:[20-Jan-2008 11:21:18] PHP Fatal error: Call to undefined function err_log() in C:\apache\Apache2\htdocs\new.php on line 3 This is perfectly ok..but when i remove err_log() function and script is.. <?php echo "Really Bad"; The out put on browser is Really Bad but the error log is empty even though there is no closing tag. how to show error 's on browser window. Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444470 Share on other sites More sharing options...
GingerRobot Posted January 20, 2008 Share Posted January 20, 2008 That is normal behaviour. Having no closing tag doesn't cause an error in PHP (as long as there is nothing after it) Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444475 Share on other sites More sharing options...
toplay Posted January 20, 2008 Share Posted January 20, 2008 PHP Fatal error: Call to undefined function err_log() There is no such function as err_log() (unless you built it yourself). The function is error_log(). Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444477 Share on other sites More sharing options...
GingerRobot Posted January 20, 2008 Share Posted January 20, 2008 Perhaps i misunderstood. I thought you were trying to generate an error by using an undefined function. Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444478 Share on other sites More sharing options...
Dave123 Posted January 20, 2008 Author Share Posted January 20, 2008 First of all ..i take my apologies that some of you didn't understand my questin..may be because of my bad english... Now let me explain it..I am totally aware about PHP will be end up its execution till last statement. but i will show you example that horifies me.. <?php echo "Really Bad". PHP_EOL ; ?> Kill Kill is also part of php file called Test.php The output i get Really Bad Kill . Please make me clear about the idea..Does PHP carries its execution beyond the tags.. Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444504 Share on other sites More sharing options...
toplay Posted January 20, 2008 Share Posted January 20, 2008 A PHP document/script/file is by default a HTML document first. That's why we have to use opening and closing PHP tags. Anything outside PHP tags is just plain HTML. So, "Kill" is displayed because the browser treats it as HTML (and not PHP displaying that). hth. Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444508 Share on other sites More sharing options...
Dave123 Posted January 20, 2008 Author Share Posted January 20, 2008 Thank you very much....I forgot this in meanwhile..you are right its html.. but what to do with this ... <?php $db= mysql_connect("localhost","user","pass"); if(!$db) { die ("not connected"); } else echo "Connected"; I don't have closing tag but it shows me connected.... Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444512 Share on other sites More sharing options...
revraz Posted January 20, 2008 Share Posted January 20, 2008 As stated above, it will display with or without a closing tag. What is your main concern? Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444514 Share on other sites More sharing options...
Dave123 Posted January 20, 2008 Author Share Posted January 20, 2008 My main concern..is how to show PHP generated error..on browser window.. Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444519 Share on other sites More sharing options...
GingerRobot Posted January 20, 2008 Share Posted January 20, 2008 Well, you'll need a script that actually has an error in: <?php $foo = 'foo' $bar = 'bar'; ?> Parse error: parse error, unexpected T_VARIABLE in wherever on line 3 Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444521 Share on other sites More sharing options...
Dave123 Posted January 20, 2008 Author Share Posted January 20, 2008 Thanks guys...I learn a lot today...thank you very much...I tweaked with so many settings..this will be very helpful for me...You all are star.... Quote Link to comment https://forums.phpfreaks.com/topic/86920-solved-php-error-displayand-mysql-connection/#findComment-444591 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.