NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] Blue dots not on each line of code


Joined: 31 Oct 2006
Posts: 9
Reply with quote
HI, Ive searched the forum and could not find a complete answer. I have just set a a new project and try to debug the home page from the browser. The cursor open on the 1st line of index.php as expected and all code lines have blue dots next to them. As I trace deeper into the programs the blue dots completely disappear but the step function goes on each line of code and I can watch variable values being set, so it seems to be working. Next I step into an include file and the blue dots are about every 10th line (approx) and even the lines with blue dots are not doing what you would expect the code to do.
OK, I know something is out of line here but what exactly. Ive tried saving the file using Save As and making sure File Format is Unix (which it was already). The File Encoding was set as WINDOWS-1252 so I left that as it was. I copied the files down from a unix server. Any clues would be really appreciated as this is driving me nuts. I have another oscommerce project and that is working fine.

HOW TO RESOLVE:

OK, I was trying to debug on a new installation of CRE Loaded 6.15(oscommerce)

Some programs had PHP code enclosed in <? ?>. Just change the <? to <?php and it will work correctly.

The offending programs in my installation were:-

/admin/index.php
/admin/xsell_products.php
popup_affiliate_help.php
popup_image.php
popup_links_help.php
popup_search_help.php
popup_wishlist_help.php
/templates/OSO6E8497TM/main_page.tpl.php

You might find others in your installation. Use Search In Files and look for the string '<? ' (without the quotes, but with a space after <?) in *.php files.

Good luck. This crap/slack coding just cost me about 8 hours of total frustration trying to find the problem.


Regards, Chris

My tech details:-
Windows XP Pro
PHPEd 5.2 build 5219
PHP 5.1.2
Apache 2.0.55
PHP Debugger 3.2.7
MySQL 4.1.7
View user's profileFind all posts by englishchrissySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
In short, line counting/numbering is a permanent problem in php. There are many related reports posted at http://bugs.php.net and they almost all are resolved 'n' closed. But still time after time people report they see lines not in-sinc. You can easily check this yourself by throwing an error on a particular line and compare this physical line number with what php printed in the error message.

What you see a blue-dots are line-info provided by php compiler. It always count them wrong if the file encoding is Mac (0xD as line end mark), it often count them wrong if HEREDOCs are used or if #!/blah/blah/php pseudo-comment is in the first line of the script.
Although, I did never face up with any problems caused by short-tags (<?) vs full (<?php)

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 02 Sep 2007
Posts: 112
Location: Kiel, Germany
Reply with quote
dmitri wrote:
It always count them wrong if the file encoding is Mac (0xD as line end mark)

Good tip, thanks! I just had some serious difficulties debugging a script because stepping through it was impossible - the debugger missed quite a lot of executable lines. Now I changed the encoding, and everything is fine. Smile

Cheers,
Jan
View user's profileFind all posts by EnigmaSend private message
RE:this topic


Joined: 24 Jun 2010
Posts: 1
Reply with quote
I like this thread. It ought to be made a sticky and a must read to all newbies
View user's profileFind all posts by smallvolumeSend private message
[resolved] Blue dots not on each line of code
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 vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic