View Full Version : Help - My First PHP script doesn't work
4-22-02, 11:18 PM
I really do not know what else to try. But my little piece of PHP code just does not work on my site.
This error essage is logged continually:
"Premature end of script "
I have checked bothe the directory as well as the file and both are chmoded to 755. The file is saved with a php extension.
My code is listed exactly below.
echo "This is a Test!";
Can someone please point me in the right direction.
4-22-02, 11:26 PM
there is nothing wrong with your script. did you make sure you uploaded it in ascii format? The directory that contains it must also be chmodded to 755.
I see everyone saying "make sure the folder is CHMODed to 755". Aren't the folders automatically set to 755? I know that the folders under my account are set this way.
Just wondering :)
4-22-02, 11:42 PM
Thank you for your quick response.
I checked the Directory and it returned the following:
drwxr-xr-x 2 1287 500 512 Apr 23 11:22 phptest
-rwxr-xr-x 1 1287 500 59 Apr 23 02:24 index.php
Which I think is correct. I also re-wrote the test script, this time in NotePad and ftp'd it to the site with the same result. Could it be that the server is not setup correctly or that my "#!/usr/local/bin/php" path is wrong. I don't know. Just asking questions is all.
If I can supply any other info please ask.
The file and folder settings are correct. As sophiespo stated, make sure the file is being uploaded in ASCII mode, not Automatic mode, which is the default mode is most FTP programs.
4-22-02, 11:48 PM
MannInc.. when i first started here folders were set to 775 when they were created.. hmm.. i usually chmod my folders to 755 anyway when i create them.. its just out of habit now. Some people try setting folder permissions to 777 sometimes..
MistyDays, did you definitely upload in ASCII format?
I see. I wasn't aware that they were set to 775 in the past, as I've only been here at PowWeb for about 2 1/2 months. Thanks for the information.
4-22-02, 11:52 PM
You guys are great!!!
Thanks so much. It was the ftp program uploading in binary format and not ascii which was the problem.
Looked ok when it downloaded........ anyway many Thanks.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.