• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding parse errors....

#1
[eluser]deco10[/eluser]
Normally when I use PHP if there is a parse error it tells me what line its on, gives me a clue at least. If there is a parse error in my controller (which there is) it just shows a blank page. My controller file is extensive and I have no idea where the error is. I'm sure there is an obvious way around this but I can't find it.

Suggestions?

Thanks!

#2
[eluser]n0xie[/eluser]
Did you turn on error reporting?

#3
[eluser]deco10[/eluser]
You mean this?

error_reporting(E_ALL);
ini_set('display_errors', '1');


I have that at the top of my conroller.php file.

#4
[eluser]n0xie[/eluser]
Hmmm usually when you get a blank page it's either that error reporting is set to off, or there is an issue with the database. Do you have the database autoloaded?

#5
[eluser]deco10[/eluser]
I stated a scenario in my initial post because that is the case sometimes. However in the case I know where the parse error is (missing ; ) I can fix this and the page displays, I take it out and I get the blank page. Database seems to work just fine either way. Error reporting could very well be set to off. How do I check/change this?

#6
[eluser]n0xie[/eluser]
Change line 12 in your index.php:
Code:
error_reporting(E_ALL);
ini_set(‘display_errors’, ‘1’);

#7
[eluser]deco10[/eluser]
I knew it was simple Smile
I just had it in the wrong place. Thanks a million!

#8
[eluser]n0xie[/eluser]
BTW you might want to use STRICT mode if you are using PHP5
Code:
error_reporting(E_ALL | E_STRICT);


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.