Yeah, turning on error reporting helps tremendously -- I hate to develop in an environment with error reporting off.<br><br>Also, there is always the old "print 'got here'; exit;" trick which can help when trying to isolate the bad line.<br>
<br><div class="gmail_quote">On Wed, Apr 14, 2010 at 4:01 PM, Earnie Boyd <span dir="ltr"><<a href="mailto:earnie@users.sourceforge.net">earnie@users.sourceforge.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">John Mitchell wrote:<br>
> I wrote my first php code within a newly created drupal module and I<br>
> got it to work.<br>
><br>
<br>
</div>Firsts are always good.<br>
<div class="im"><br>
> Initially it was not working (Drupal would not come up) and I did not<br>
> know what was wrong so started to take out lines until Drupal finally<br>
> came up and that is how I discovered which line had the syntax error.<br>
> Once I knew which line it was I fixed the problem and put it back in<br>
> the code and drupal came up.<br>
><br>
<br>
</div>The hard way to debug it. :)<br>
<div class="im"><br>
> My question is in the future if I have this problem again where Drupal<br>
> does not come up because of some php code within a custom module<br>
> erroring off what is a more efficient way for me to detect and fix any<br>
> php syntax errors?<br>
><br>
<br>
</div>Any number of ways. If you're using apache the error would be in the<br>
error.log file. And if you set the php.ini file with a log file or<br>
syslog then it would be there. And then there is the PHP display_errors<br>
setting that can be set in .htaccess or settings.php file.<br>
<br>
.htaccess you would add<br>
php_value display_errors 1<br>
<font color="#888888"><br>
--<br>
Earnie<br>
-- <a href="http://progw.com" target="_blank">http://progw.com</a><br>
-- <a href="http://www.for-my-kids.com" target="_blank">http://www.for-my-kids.com</a><br>
</font><div><div></div><div class="h5">--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br>