PHP question :: getting syntax errors to output

  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post March 27th, 2004, 8:29 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 27th, 2004, 8:29 pm

  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 6382
  • Loc: twitter.com/unflux
  • Status: Offline

Post March 27th, 2004, 8:37 pm

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.
UNFLUX.FOTO
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Joined: Mar 20, 2004
  • Posts: 401
  • Loc: Scorpion Hole
  • Status: Offline

Post March 27th, 2004, 11:01 pm

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
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post March 28th, 2004, 8:52 am

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
  • Joined: Dec 20, 2002
  • Posts: 6382
  • Loc: twitter.com/unflux
  • Status: Offline

Post March 28th, 2004, 9:02 am

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.
UNFLUX.FOTO
  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post March 28th, 2004, 9:25 am

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
  • Joined: May 17, 2003
  • Posts: 1121
  • Loc: Boston
  • Status: Offline

Post March 28th, 2004, 9:35 pm

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
Free Programming Resources
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 6382
  • Loc: twitter.com/unflux
  • Status: Offline

Post March 29th, 2004, 8:15 pm

good stuff richB, thx :D
UNFLUX.FOTO

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 104 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.