Premature End of Script Headers / fopen: Permission denied

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Premature End of Script Headers / fopen: Permission denied

Postby Jackanape » Thu Jul 26, 2007 3:10 pm

I'm posting this as a solution to those potential users who may run into the same problem as I did, both this time, and once before...

The first time I ran into the problem, I had the server administrator fix it, it was when I initially installed Coranto, and it just wouldn't RUN, and EVERYTHING was in order, permisions, etc...

This time, I'm installing another .cgi script, with the same results:

I get a 500 server error, with a
premature end of script:
warning...I double, and triple checked my settings, my CHMOD, you name it, and finally, contacted the server admin...he sent me the following error log entries from my misadventures:
[Wed Jul 25 23:14:46 2007] [error] [client xx.xx.xxx.xxx] failed to
open log file
[Wed Jul 25 23:14:46 2007] [error] [client xx.xx.xxx.xxx] fopen:
Permission denied
[Wed Jul 25 23:14:46 2007] [error] [client xx.xx.xxx.xxx] Premature
end of script headers: index.cgi

After an exhaustive search, I learn he's running a UNIX server, and it's a line break issue, such as the one mentioned by Parahead HERE.

So, the solution was to run the script through the dos2unix convertor. (This is another fine example of why we must always know what server we run on, even though, in this case, I still wouldn't have known the solution to the problem...)

So, for the edification of future Unix troubleshooters, I've included a link to download dos2unix right here at Coranto.org:

http://www.coranto.org/downloads/other/uddu.zip

This also contains a unix2dos convertor.
In a Windows XP environment, I simply unzipped the file, and dragged and dropped my file right onto dos2unix... :wink: ...easy as pie for a simpleton like me!
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Lumberjack » Thu Jul 26, 2007 6:05 pm

I have commented on this before, and have converted all the DEV files to the appropriate unix line endings. Does a windows server mind running these? I have a feeling that it isn't really bothered. Someone please test that. In which case, all developers should make sure they are developing coranto with unix line endings, as that is the universally executable solution.
Lumberjack
 
Posts: 555
Joined: Wed Jan 10, 2007 7:22 pm
Location: Oxford, UK

Postby Jackanape » Thu Jul 26, 2007 6:38 pm

I have installed the dev version on a Linux box with no adverse effects.

Let's find the developers guide, and add this to it...it's around here somewhere! :wink:
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Lumberjack » Mon Jul 30, 2007 5:40 pm

Lumberjack wrote:Does a windows server mind running these? I have a feeling that it isn't really bothered. Someone please test that.


Actually this is what I meant. If windows-based developers can manage without changing to windows line endings then there should be no problems.
Lumberjack
 
Posts: 555
Joined: Wed Jan 10, 2007 7:22 pm
Location: Oxford, UK


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 5 guests

cron