PHP question :: getting syntax errors to output

  • Willy
  • Graduate
  • Graduate
  • Willy
  • Posts: 199

Post 3+ Months Ago

I'm coding on my new server now... When i make syntactical php errors I don't get any messages to the screen when i run via web... Is this a apache issue or a php issue??

how do i fix this?

I was thinking there miht be a flag in php like error_displaying();

but i couldnt find it on php.net

THanks
WILLY
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

well, this probably means that php is not enabled on the server if
there are no errors. make a page called test.php and put this on it
and save to the server:
Code: [ Select ]
<? phpinfo() ?>

if info shows up when he goes to the page then it IS enabled, and
he needs to check it out. If nothing shows up except
"<? phpinfo() ?>" then you have no php capabilities.
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Also if PHP is enabled on the server, you could have it set to not display the errors, with that you would have to set it in your php.ini file located somewhere on the server.
  • Willy
  • Graduate
  • Graduate
  • Willy
  • Posts: 199

Post 3+ Months Ago

Php runs quite fine... Errors are just not echoing to the screen when i make errors. It just resuseds to run and says nothing.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

php produces and shows parse errors and line#'s be default. what sort of errors are you looking for?

and if you can't see at least that much, something's not right with
the php config.
  • Willy
  • Graduate
  • Graduate
  • Willy
  • Posts: 199

Post 3+ Months Ago

I thought it was default as well... But php is running great. It's just a little difficult for me to debug my code because

http://www.stahler.org/test.php



http://www.stahler.org/test2.php

contains:
Code: [ Select ]
<?
XXX
?>
  1. <?
  2. XXX
  3. ?>



Nothing is output though
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

I think when you use XXX like that the parser thinks it's an undefined constant and according to the PHP manual:

If you use an undefined constant, PHP assumes that you mean the name of the constant itself, just as if you called it as a string (CONSTANT vs "CONSTANT"). An error of level E_NOTICE will be issued when this happens.

If I understand the manual correctly E_NOTICE is not reported by the default setting in the php.ini.

Try this and see if you get the notice:

<?php
error_reporting(E_ALL);
XXX
?>

Check out the PHP manual for more info:

http://www.php.net/manual/en/ref.errorfunc.php
http://www.php.net/manual/en/function.e ... orting.php
http://www.php.net/manual/en/language.constants.php
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

good stuff richB, thx :D

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 111 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.