View Full Version : PHP File Issue
musicman2059
01-21-2006, 08:08 AM
I'm not saying that there's an actual issue with 1stpage yet, but that there might be. I'll have to see farther down the road.
Last night I was working on a new PHP file, and after I had finished it and uploaded it, I was getting parse errors for a stray $. I checked over the document several times and had no idea in the world where this was. To no avail, I sent an e-mail to the site's owner to take a look over it.
She replied to it with a couple of suggestions, but all I ended up doing was opening the problematic PHP file in wordpad, saving it (didn't make any modifications to it at all), and re-uploading it. After that, the page worked fine.
I'm not completely sure, but maybe there's a problem with the way 1stpage saves PHP files? I didn't have this problem in 2000.
PsychoticDude85
01-21-2006, 08:28 AM
I think that was probably only a random occurance. I have had things like this happen before in a variety of pages. I write the code, and the uploaded code for some reason ends up different to that in the saved file.
I think that may be the problem, if you have this problem again, go to http://pastebin.com/ and add your code that your CPanel account sees. Then in the same page (so you see your code and the input at the bottom) paste your code in the saved file in and upload that. Then on this new page click on differences and look through. You may notice a difference in a line or two, I don't know what causes this, but it seems to happen sometimes for no forseeable reason.
musicman2059
01-22-2006, 12:43 AM
Created another new php file, and got the exact same problem. I diffed the online version with my version and they are exactly the same.
I then opened that same file up in HTML-Kit, saved and uploaded it, and it worked fine. I'm confident that the problem here lies within 1stpage.
version2
01-22-2006, 08:48 PM
When I downloaded the beta of fp 2006, I had this exact same problem. Even a simple script such as:
<?php
phpinfo();
?>
would give an error. I never had this problem with fp 2000. Since then, I've trashed using fp 2006 and went back to 2000. This is a big problem. Who cares about any other bugs 2006 has, this one needs to be fixed. I'll download 2006 again, and try to see what is happening.
PsychoticDude85
01-22-2006, 11:45 PM
Weird, very weird... I don't see why it would have problems if the copies are the same. But I will conceed you are right, I haven't used FP06 being on Slackware, so I will leave this for someone more qualified to answer.
I would still say it's weird though :|
Weird, very weird... I don't see why it would have problems if the copies are the same. But I will conceed you are right, I haven't used FP06 being on Slackware, so I will leave this for someone more qualified to answer.
I would still say it's weird though :|
I have the same problem.
Since yesterday (wednesday) I have installed version 2006.
If I save a PHP-document (made by version 2000) in 2006-version and you look at the document with i.e. notebook you see no alignments.All the lines are after each other.
If I use it in my local Apache/PHP environment then the program runs fine (strange).
If I upload the program to my external server then I got several errors.
If I use version 2000 and I saved the document then the document is good aligned and if I upload this to the external server the program runs fine. (also local).
It seems to me there is something wrong with the saving format in 2006!
I have the same problem.
Since yesterday (wednesday) I have installed version 2006.
If I save a PHP-document (made by version 2000) in 2006-version and you look at the document with i.e. notebook you see no alignments.All the lines are after each other.
If I use it in my local Apache/PHP environment then the program runs fine (strange).
If I upload the program to my external server then I got several errors.
If I use version 2000 and I saved the document then the document is good aligned and if I upload this to the external server the program runs fine. (also local).
It seems to me there is something wrong with the saving format in 2006!
I have tried something and the problem is solved. I don´t know if this is the right method, but it works.
The problem is there if I load a PHP (perhaps also other, but that i haven´t tested) made by version 2000. The source look nice in the 2006-editor, also formatted and correct linebreaks.
If I save the document then there is a problem with the linebreaks. Every line is put behind the previous line etc. If I upload the program then the server give me errors.
Solution
If I change the document encoding of the document in i.e. "Central European ISO-8859-2" (but I think another is also ok) save this and save the document then the linebreaks are correct and the program runs fine.
You can chnge the encoding via : format -->document properties. Here you can change the encoding.
PsychoticDude85
02-09-2006, 03:28 PM
If I use it in my local Apache/PHP environment then the program runs fine (strange).
Are PHP errors set to display E_ALL (and possibly E_ALL|E_STRICT if you have a later version of Apache)? If not then it may only be logging the errors in a file (it would be very peculiar to have neither method on).
Not sure how to configure Apache on Win, I know you can change httpd.conf in Unix systems, but I can't advise you on how to check yours...
MrSpandex
02-22-2006, 03:23 PM
No, this happened for me too. It really is annoying. PHP is on all my pages, so FP is now useless. Oh well... no more annoying nag screen for me!
Galactic
02-22-2006, 05:51 PM
PsychoticDude and MrSpandex,
While PsychoticDude was replying to axel's post of a problem with PHP, axel was repyling to his own post to report a solultion to his problem. It is easy to miss a post that comes in while one is replying to a previous post and I cannot tell that either of you saw axel's solution post.
Does axel's solution work for you?
MrSpandex
02-22-2006, 07:34 PM
I didnt expect the solution to work, and it did not. The formatting only adds a meta with the carachter encoding to the code, which shouldnt make ANY difference at all. It does nothing within the editor, which is where the problem is. In fact, if I comment out the first line (the one that always gets the error, no matter what is there) I still get a blank, white screen, which, after using notepad, is filled with debigging echo statements. No, this is a much deeper problem than a simple charset, though probably not that hard to fix. I think that 1stpage is screwing something up around the <?php tags. This is not visible, however, and seems strange to me, as it doesnt show up when opened in any other editor.
Don't get me wrong, Ive used 1stpage for 5 years now and I love it, but this is just too much of a bug. This combined with the nag screen has put me into a mad search for a replacement. I want this bug squished, I really do.
Galactic
02-22-2006, 09:11 PM
No, this is a much deeper problem than a simple charset, though probably not that hard to fix. I think that 1stpage is screwing something up around the <?php tags. This is not visible, however, and seems strange to me, as it doesnt show up when opened in any other editor..
Thank you for the extended explanation.
I thought that because workarounds were found for program crashes that the situation was looking brighter. I did not anticipate this. And this is not just in PHP. A similar sounding problem is now reported with simple scripts not working. The shame is perhaps it would take the developer less than a month to get this straightened out. (Just a guess; I don't know that.) I haven't decided whether I wandered into an epic or a Greek tragedy here.
Some users are going back to 1st Page 2000. Does that version not support your needs because it does not handle PHP or are there other problems with that version?
MrSpandex
02-23-2006, 06:51 AM
I wish I could...
2006 has the nice syntax highlighting, but I wouldnt mind going back to 2000. Everytime I install it though, it loses the temp files it needs. The auto-extractor just doesnt work for me. I don't understand it. Its like the temp files get deleted before it can use them. When I go to look for them, I can never see the directory/files its looking for.
I love 2006, and I love 2000. But now neither work :(
Galactic
02-23-2006, 07:12 AM
Have you tried PHP Developer? A strong final beta of the new 2006 version came out on January 10. Tarmithius thinks it is wonderfully improved over the 2005 release (his post is on a different forum site). I installed it today along with a recommended local host and the recommended php.net help file. Installation was no problem at all. I opened it but I have not yet gone farther with it. It is freeware. There is a request for tips when you exit the program, a.k.a. Nag Screen, but there is no count down before you can close it. There is no "Pro" version . It is the same application for all. It also does HTML.
MrSpandex
02-23-2006, 07:20 AM
Yea, I tried 200, but it was just too heavy for my needs. It was slow and cumbersome for developing small little php scripts. I'll have to try it out again I guess, thanks for the tip.
PsychoticDude85
02-23-2006, 09:29 AM
PsychoticDude and MrSpandex,
While PsychoticDude was replying to axel's post of a problem with PHP, axel was repyling to his own post to report a solultion to his problem. It is easy to miss a post that comes in while one is replying to a previous post and I cannot tell that either of you saw axel's solution post.
Does axel's solution work for you?
It was a solution, yes. But to a different thing. I was saying that if you get an error on hosting but not on your local Apache then maybe it's the httpd.conf. Not the solution to the file saving incorrectly. It's still worth looking into regardless of the problem being fixed.
MrSpandex
02-23-2006, 09:43 AM
Well, PHP Designer 2006 and notepad work fine. In fact, I have to copy-paste over the whole thing to make it work. But no changes to the text made any difference. It is certainly a file writing issue.
Galactic
02-23-2006, 01:58 PM
The Solution of this Thread Wrapped Up
When you select the encoding that axel suggested, the following line is put in the document header:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
If you save the document and reopen the document and go and have a look at the format/properties, this charset will show as selected. The default for 1st Page 2006 is “none/ don’t change”. A better default might be “iso-8859-2/don’t change”. Here is what you seem to have to do:
Open 1st Page 2006. Using file/open, browse to the templates in the template directories under the program file. Select a template you plan to use. Open the template. Use format/properties to set the character set to iso-8859-2. You will see the meta line written to the template file. Now save the template file in its original location. There is nothing special about the templates, they are just html code saved in a particular place. Repeat to cover all the templates you are interested in.
Now, what about when you open a file prepared outside of 1st Page 2006? If you are going to edit it in 1st Page 2006 , then you had better use format/document select iso-8859-2 character set to insert the meta line first thing. It will be inserted in the proper place automatically.
The Solution was Revealed in These Excerpts:
... all I ended up doing was opening the problematic PHP file in wordpad, saving it (didn't make any modifications to it at all), and re-uploading it. After that, the page worked fine.
I have tried something and the problem is solved. [snip]
If I change the document encoding of the document in i.e. "Central European ISO-8859-2"...and save the document then the... program runs fine.
You can change the encoding via : format -->document properties. Here you can change the encoding.
I have to copy-paste over the whole thing to make it work. But no changes to the text made any difference. It is certainly a file writing issue.
Musicman, got onto the origin of the problem quickly and produced the original workaround. Axel found a more practical solution to the file writing issue than cutting and pasting code. The other posts provide some confirmation.
If Axel had not told us exactly where to find where we can change the character encoding, I would never have found it.
Another thread report that a simple script in a html document did not work after being written and saved in 1st Page 2006. I expect axel's solution to fix that. The problem reported in this thread is more then a “PHP file writing error” problem, it is a general file writing error.
I am adding this solution (promising, not yet proven) to my post on what to do to get 1st Page 2006 to work. I am trying to collect together all the fixes, known or promising and put them there. Everyone is welcome to post replies to that thread. Some chatter over there would help.
PsychoticDude85
02-23-2006, 02:03 PM
...you just took two parts of my post completely out of context and ignored the actual point? I'm sorry, but I count that as rude.
EDIT: Also my post was not in reply to Axel's problem with PHP, but was concerned with his HTTPD configuration. They are hardly the same thing, by a large margin.
EDIT2: Ok, maybe you were talking to MrSpandex more than me in that post. But it was still relevent regardless of the saving being sorted.
Galactic
02-23-2006, 02:59 PM
...you just took two parts of my post completely out of context and ignored the actual point? I'm sorry, but I count that as rude.
EDIT: Also my post was not in reply to Axel's problem with PHP, but was concerned with his HTTPD configuration. They are hardly the same thing, by a large margin.
Added in edit: The following was deleted from the thread starting post, this was PschoticDude85's preference. It is put here so that readers can follow what he was referring to in his preceeding post.
[Axel’s] was a solution [snip] to the file saving incorrectly.
The snip connects parts of two sentences to highlight one of the things in this post.
End of edit.
I missed that you were responding to a different thing that axel had posted. I was not trying to slight the main point in your post and I attempted to give a heads up, with an italicized explanation about the snip that you had more to say, had a different main point, all intended to suggest that people go back to your original post. However, I went back several times over my entire post, editing to shorten it, before I posted it. Some of the detail about my snip was removed during that editing. I regret not giving a longer explanation.
I appreciate your response and I regret that you found found my post rude. I did not intend it to be. We don't need any rudeness in these forums. They need all of us in my view. Do you want me to add more detail about your original post and my snip of it or remove that part of my post, your preference? I would add anything I delete there to this response by an edit. Otherwise, it would be rude to you for me to change anything. If you want me to, let me know and give your preference of addition or deletion.
PsychoticDude85
02-23-2006, 03:12 PM
Delete it. I don't think much of cutting posts up into random sections and reasembling them to give it a new meaning. It's a manipulative journalistic way of writing, and I think we want to keep our writing objective.
Thank you for your reply however. Glad that you realised how others might feel about it. All even?
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.