Forum Moderators: coopster

Message Too Old, No Replies

How to prevent parse errors?

         

brianru

2:54 am on Apr 15, 2004 (gmt 0)

10+ Year Member



I am currently pretty new at having a website but I have sIk Clan site. I have been having an ongoing problem with parse errors. I have encountered them about a dozen times and have fixed them by either getting a new copy of the file or more recently when there were so many errors with everything I had to start the site from scratch. So I have looked everywhere and no one seems to know how to fix parse errors. I understand that the error occurs when code is spliced into more lines. The change to the files occurs when the file is being uploaded and it seems the number of lines are doubled. So far my host has failed to see how this is their problem and they seem to think this is a problem with phpbb. By the way I am using the phpbb2.08 message board thing. So I want to make sure if this is a server issue and how to fix it?

[edited by: jatar_k at 4:57 am (utc) on April 15, 2004]
[edit reason] removed personal url [/edit]

Birdman

3:26 am on Apr 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, I believe this is a ftp issue on your part. It is the difference between uploading in binary and ASCII modes. Check the settings on your ftp program and adjust accordingly.

Birdman

brianru

3:32 am on Apr 15, 2004 (gmt 0)

10+ Year Member



So which should I use?

isitreal

4:10 am on Apr 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ASCII for anything that looks like text, .htm, .php, .htaccess, .css, .js and so on.

If you can edit it on a text editor, it's ASCII, more or less anyway.

Binary is for things like .jpg, .gif, .swf, .png ,.pdf, things that you can't edit as text that is.

brianru

9:25 pm on Apr 16, 2004 (gmt 0)

10+ Year Member



I tried that and I am still getting errors. With php documents.

brianru

3:04 am on Apr 18, 2004 (gmt 0)

10+ Year Member



Just to tell you I am using a mac with the cuteftpmac trial. Just in case that could have something to do with it.

ergophobe

3:15 am on Apr 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What parse errors are you getting? Can you give a couple of examples of both the error and the line concerned as well as about two lines above the line signalled but the error message?


number of lines are doubled.

[edit]Sort of grasping at straws. This assumes that you are in fact uploading as ASCII and have ruled out that binary/ascii issue[/edit]

What do you mean doubled? Is it splitting lines in the middle? If so is there some wordwrap or line length issue with either your editor or your FTP client?

Or is it just inserting a blank line after the regular lines? In that case, it could (longshot) be related to incompatibilities in the newline characters?

Windows newline: cr + lf
Unix newline: lf
Mac newline: cr

Usually that's not a problem though and some FTP clients take care of it with ASCII files by translating the eol characters.

Also, Whitespace should be ignored in PHP, so doubling the number of lines should change anything.

brianru

2:57 pm on Apr 18, 2004 (gmt 0)

10+ Year Member



After every regular line it adds a line but sometimes it splits a line in the middle. It may be that I am on a mac.

ergophobe

3:55 pm on Apr 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Offhand, I would guess it's a combination of two things

- word-wrap settings in your editor
- the different newline sequences between different OSes.

Start by checking your editor settings.

brianru

4:04 pm on Apr 18, 2004 (gmt 0)

10+ Year Member



I checked the dreamweaver preferences and changed it to cr since I am using a mac. That should do it, right?

isitreal

5:13 pm on Apr 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Test the setting, upload a php file, then download it again, see if the linebreaks remain the same or not. And of course make sure it runs once uploaded.

You might have some setting in there that forces linebreaks even when they shouldn't be there, in other words, a linebreak is inserted anytime a linebreaks for display purposes, you want to get rid of that too if you can find that setting.

ergophobe

5:21 pm on Apr 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Actually, you probably want it set to the newline style of the destination server.

In any case, this should never be splitting your lines in the middle and I wouldn't think the wordwrap would be an issue in Dreamweaver.

I would now guess that I'm wrong on both counts and I'm out of ideas.

Tom

brianru

6:13 pm on Apr 18, 2004 (gmt 0)

10+ Year Member



I took a file, uploaded it, than downloaded it. No change. Thanks for everyone's help!

brianru

9:11 pm on Apr 19, 2004 (gmt 0)

10+ Year Member



The server is a linux server. So should I change it to the unix one or should I leave it at cr since I am on a mac?

isitreal

9:28 pm on Apr 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I suspect the problem you are having comes from somewhere else. As Ergophobe said, most ftp clients automatically take care of the linebreak issue, I've never seen that on any windows upload I've done ever, although Mac ftp clients are from what I've seen less than stellar unless you pay for them.

Why don't you post the parse errors you are getting, along with the code from that section and see if someone can figure it out.

ergophobe

9:51 pm on Apr 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




I've never seen that on any windows upload I've done ever

The only problem I have seen is that when you save a file under windows and then upload it to CVS, it will diff the entire file b/c as far as the diff program has concerned, every line has changed.

I've never seen it cause a parse error under PHP.

brianru

1:24 am on Apr 20, 2004 (gmt 0)

10+ Year Member



I can't show you an example because I got rid of the template that they were in and trashed it figuring I would never need one full of errors. Though I remember one where it was a snippet of code and in the middle of the line the word message was split to
mes
sage

Also I am still using the trial of CuteFTP.

brianru

1:28 am on Apr 20, 2004 (gmt 0)

10+ Year Member



Is there another mac ftp client that you know is good?

jatar_k

1:46 am on Apr 20, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I used anarchie on Mac but it has been a year or two

isitreal

4:24 am on Apr 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Transmit and Fetch are supposed to be good, but are not free, I'm not sure how their OS X versions are, I haven't followed that either. If there is a decent free ftp client for macs, either OS 9 or X, I'd like to know its name so I can recommend to it to mac users when that question comes up, something roughly equivalent in features and functionality to the free WS_FTP LE, which is completely adequate for most users and most applications, nothing special, but OK.

I took a quick look and it seems that Anarchie is for OS 9 only.

brianru

11:44 am on Apr 20, 2004 (gmt 0)

10+ Year Member



I found one called interarchy, it looks like it is made by the same people that made anarchy. It looks pretty good.

isitreal

3:22 pm on Apr 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Interarchy is also trialware, has to be licensed to use, at least that's what their website says.

isitreal

5:47 pm on Apr 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I came across this statement in the phpMyAdmin documentation, 'configuration' section [phpmyadmin.net]:

Warning for Mac users: PHP seems not to like Mac end of lines character ("\r"). So ensure you choose the option that allows to use the *nix end of line character ("\n") in your text editor before registering a script you have modified.

brianru

7:30 pm on Apr 20, 2004 (gmt 0)

10+ Year Member



I saw that the site says it's trialware. But i downloaded it and am using it and it hasn't givin me a single message so far saying that I need to pay. So if in the end I do have to pay it is much faster and does everything I need. So I might as well just own it.