cancel
Showing results for 
Search instead for 
Did you mean: 

A refresher on (Force9) php please

quelquod
Pro
Posts: 668
Thanks: 163
Fixes: 1
Registered: ‎31-07-2007

A refresher on (Force9) php please

With the announced changes on ccgi I thought that I'd try putting a couple of forums which I run back onto PN. I moved them to another host several years ago because of bandwidth issues and they still run fine there. I have just copied the whole existing trees to their own folders in ccgi root and I'm getting the "Premature end of script headers: index.php" error messages. The permissions seem OK I think (not sure though - 750 & 640)? I'm well out of date with the Force9 ccgi so any help/pointers would be much appreciated.
Thanks.
Democracy - 3 wolves and a lamb voting about what to have for lunch!
7 REPLIES 7
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: A refresher on (Force9) php please

I suggest setting up and running Gabe's script posted in the opening post ... please see Edit below and Reply #6 ... from your ccgi root to ensure all directory and file permissions are set correctly. Instructions for use are in the post (you need to set the permissions for that script to 0700 so it will run).
If you still get errors after running that the contents of any .htaccess files need to be checked.
See also CGI Platform PHP Upgrade FAQ
David
Edit: I've removed the link from the first line since it is now not the correct one.
David
[Moderator's note by Jim (Oldjim)  link fixed ]
David
quelquod
Pro
Posts: 668
Thanks: 163
Fixes: 1
Registered: ‎31-07-2007

Re: A refresher on (Force9) php please

Hi spraxyt,
I don't think this addresses the same problem.
I have tried it though and it seems to do what it says on the tin but I still have the basic problem that any php script returns the error mentioned above.
For instance, the php file ('imhere.php'):
<?php echo '<p>php is alive</p>'; ?>
returns the error:
<<<
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: imhere.php
If you think this is a server error, please contact the webmaster.
Error 500
ccgi.myaccountname.force9.co.uk
Tue Dec 24 16:38:28 2013
Apache
>>>
Do I have a more fundamental problem?
BTW I'm not using any .htaccess files ATM.
Thanks
Democracy - 3 wolves and a lamb voting about what to have for lunch!
quelquod
Pro
Posts: 668
Thanks: 163
Fixes: 1
Registered: ‎31-07-2007

Re: A refresher on (Force9) php please

replying to my own post:
Well it does seem to be some sort of permissions problem although I don't have any group or world write enables.
The same simple php file works fine within cgi-bin (didn't think it would run there oddly.....!)
Investigation continuing.....
Democracy - 3 wolves and a lamb voting about what to have for lunch!
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: A refresher on (Force9) php please

Hmm, I wonder if your root directory has incorrect permissions.
Could you try creating a folder, say testing, set its permissions to 0710 and put your imhere.php file into it (0700). Does it work if you browse to /testing/imhere.php ?
On current ccgi use of /cgi-bin is unrestricted and it has no special properties. However on the new server it does. Perl and .cgi scripts have to be in /cgi-bin and be executable. PHP scripts must *not* be in /cgi-bin and need not be executable.
(An addhandler statement can be added to .htaccess to change the placement restriction on Perl and shell scripts.)
David
quelquod
Pro
Posts: 668
Thanks: 163
Fixes: 1
Registered: ‎31-07-2007

Re: A refresher on (Force9) php please

Sorted thanks!
Embarrassing finger trouble!  Embarrassed
Democracy - 3 wolves and a lamb voting about what to have for lunch!
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: A refresher on (Force9) php please

The link in my reply #1 should be to http://community.plus.net/forum/index.php/topic,84349.0.html and not to where it pointed.
David
quelquod
Pro
Posts: 668
Thanks: 163
Fixes: 1
Registered: ‎31-07-2007

Re: A refresher on (Force9) php please

Handy script, thanks.
I had done it similarly though less elegantly  Wink
Democracy - 3 wolves and a lamb voting about what to have for lunch!