RE: [PHP] All Parse Errors on Line 1

From: Date: Fri, 01 Dec 2000 05:52:06 +0000
Subject: RE: [PHP] All Parse Errors on Line 1
Groups: php.general 
Request: Send a blank email to php-general+get-28167@lists.php.net to get a copy of this message
You are probably using sessions or cookies and your PHP file (or any included file above) does not start from <?. even a space or a newline will cause that. This is might not be related to the line 1 error. If you have a page with many ins&outs or better say jumping in and out from PHP mode to HTML like : <HTML> <? staff(); ?> <BODY> <?other_staff()?> <MORE HTML> <? etc() ?> </HTML> then the parser "gets confused"? somehow and shows you all the errors on line 1. I have no Idea why is that, but it happens on my pages as well when I only have to include very few PHP in it and use the page style as I showed you above. You can check it by this (if it is related or not) make sure your file works, then provocate a parse error (easy isn't it?) and see the line. If it's line 1 then remove the error and place there echo __LINE__; __LINE__ is supposed to give you the real line number which it is places on. if it gives you line 1 while being any above it , then there's nothing wrong with it. It is just a something I don't know what it caused by. (Any of you knows why?) Cheers, Maxim Maletsky -----Original Message----- From: Paul Burney [mailto:burney@gseis.ucla.edu] Sent: Friday, December 01, 2000 2:29 PM To: chip carman; php-general@lists.php.net Subject: Re: [PHP] All Parse Errors on Line 1 >>> I've inadvertently done something to cause all parse errors >>> in php3 or php4 to ALWAYS produce 'parse error on line 1'. >>> Somehow related is anytime I try to send 'header' info I always get >>> the message that 'headers already sent'. We've checked >>> configurations (apache 1.3.9, php 4.0.3pl1, linux 2.2.14) and can't >>> seem to find the problem.... It's possible that you're files have the wrong line ending characters on them. This often happens if you are using a Mac to edit the files or if your FTP client is misconfigured. Make sure to upload in ASCII format and, if possible, try to save with Unix linefeeds in your editor. Hope it helps, Paul ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Paul Burney Webmaster and Internet Developer Educational Technology Unit Graduate School of Education and Information Studies University of California, Los Angeles (310) 825-8365 <webmaster@gseis.ucla.edu> <http://www.gseis.ucla.edu/> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#28167) next »