cancel
Showing results for 
Search instead for 
Did you mean: 

PHP upgrade killed my Wordpress site...

pushbike
Hooked
Posts: 9
Thanks: 2
Registered: ‎12-04-2010

PHP upgrade killed my Wordpress site...

Hi Folks,
Since the PHP upgrade my Wordpress install has stopped running with a
'Premature end of script headers: index.php' error.
When you try and bring up the homepage. I've followed a few threads over here and tried setting the recommended permissions (including blanket setting everything with 755) to no effect.
I've followed Gabe's suggestions for creating a .cgi permissions script, set it to 700, but trying to run that in a browser brings up a
'Premature end of script headers: perms.cgi' error instead.
.htaccess just has a couple of comment lines in it so I don't think that's doing much...
Anyone out there seen anything similar or have any thoughts as to what might be happening?
Thanks in advance...
Andrew.
12 REPLIES 12
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: PHP upgrade killed my Wordpress site...

If you create php_info.php containing
<?php
phpinfo();
?>
FTP it to your root ccgi directory (/), change its permissions to 0700 then browse to it does that run?
If not, if you move it down a level set permissions on that directory to 0710 (file still 0700) and browse to it will it run?
If it still will not run make sure you do not have a .htacess file in either / or that directory - comment them out by adding a letter in front of the dot if necessary.
David
David
pushbike
Hooked
Posts: 9
Thanks: 2
Registered: ‎12-04-2010

Re: PHP upgrade killed my Wordpress site...

Hi David,
Thanks for your help, there could be life in the website yet!
Quote
FTP it to your root ccgi directory (/), change its permissions to 0700 then browse to it does that run?

That came up with the premature end of script error again...
Quote
If not, if you move it down a level set permissions on that directory to 0710 (file still 0700) and browse to it will it run?

Ahh! Now that did run Smiley
Quote
If it still will not run make sure you do not have a .htacess file in either / or that directory - comment them out by adding a letter in front of the dot if necessary.

Commenting out the .htaccess didn't make any odds when trying to run stuff from the / directory. Does that mean I need to move everything into a subfolder of / and reference it in some way?
Thanks for your help - it's much appreciated!
Andrew.
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: PHP upgrade killed my Wordpress site...

Quote from: pushbike
Quote
If not, if you move it down a level set permissions on that directory to 0710 (file still 0700) and browse to it will it run?

Ahh! Now that did run Smiley

OK, that is what I was hoping to hear. Smiley
I think the problem could be that permissions on your root directory are not set correctly. If that is the case you can't change it yourself, Plusnet have to do it.
What you can do is check those permissions, but demonstrating the ability to run a script was essential first.
Create a file called toplevelperms.cgi (and that extension is important) containing
#!/bin/bash
echo "Content-type: text/plain"
echo
ls -l -d ../
FTP it to the directory one level down where you know files run. Change it's permissions to 0700 and browse to it.
You should get something like
drwx--x--T 8 username cgiusers 4096 Mar 25 01:09 ../
(that's chmod 1710) but I suspect you will have something else there.
If that is the case, give the CSC a ring and ask for it to be fixed.
David
David
pushbike
Hooked
Posts: 9
Thanks: 2
Registered: ‎12-04-2010

Re: PHP upgrade killed my Wordpress site...

...you're right I get:
drwx-wxrwx 7 username cgiusers 4096 Apr 13 09:16 ../
I'll get a ticket raised!
Thanks for being patient - I've just discovered you answered a similar question not that long ago  Embarrassed
You've certainly been more help than Plus Net  Smiley
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: PHP upgrade killed my Wordpress site...

Thanks for your kind remarks. Glad we located the problem. Smiley
Once the top-level permissions are fixed the directory and file permissions within your WordPress installation would probably benefit from sorting put using Gabe's script which I think you've already stored as perms.cgi.
Unfortunately the script only modifies directory and .cgi/.pl/.php file permissions so files of other types need changing manually to 0640 (or 0600 if not read by browsers) - see cgi platform php upgrade faq.
Additionally if your installation contains uploaded images you might find images don't display after running Gabe's script. This is because the images need to be readable by the web server. The following quote describes how to fix that.
Quote from: spraxyt
The permissions on the WordPress uploads directory (which is created when you upload your first image) are probably 0710 if you've followed the recommendations for CCGI. Change these for the uploads directory, and any  sub-directories of uploads that WordPress might have created to 0750. Change the permissions of existing images to 0640. Images uploaded in future should automatically inherit 0640 from the directory structure.

David
David
pushbike
Hooked
Posts: 9
Thanks: 2
Registered: ‎12-04-2010

Re: PHP upgrade killed my Wordpress site...

...all sorted now. A rude twitter post alerted PlusNet who finally sorted the rights out on the folder and the perms.cgi came in very handy for sorting the permissions out - back up and running again.
Thanks!
noel1
Dabbler
Posts: 18
Registered: ‎07-07-2009

Re: PHP upgrade killed my Wordpress site...

I have a similar problem in that I cannot access domain /wp-admin. I get the error 500, premature end of script headers: index.php
Does anyone know how to get round that one???
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: PHP upgrade killed my Wordpress site...

I assume that means you are trying to install WordPress in the top level directory (/) rather than in its own folder. However your problem is likely to be file/directory permissions related, or disallowed options in an .htaccess file.
If you carry out the check mentioned in reply #1 will that simple program run?
David
David
kgdonnelly
Newbie
Posts: 3
Registered: ‎11-07-2010

Re: PHP upgrade killed my Wordpress site...

I am having the same problem when trying to install Joomla!
Unfortunately I am not very experienced with this website malarky and was wondering what is meant by 'running' a file? When I attempt to access the files in question it asks me to login, then asks me if I want to open or save the file. When I click open it just shows me the text in the file in my web browser, nothing seems to 'run'. Am I being a bit thick or is there something amiss? Any help would be great, thanks
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: PHP upgrade killed my Wordpress site...

'Running a file' means to enter its URL in your browser and execute it. However that has to be done using HTTP and not FTP, (The latter is used for transferring files in either direction between your own computer and the server.)
Try replacing 'ftp:' in your address line with 'http:' and if you made the file executable (chmod to 0700) you should find it will execute (run).
David
kgdonnelly
Newbie
Posts: 3
Registered: ‎11-07-2010

Re: PHP upgrade killed my Wordpress site...

Something so simple, I'm an ideot for not realising, thank you for your help and making me realise I'm a bit thick  Roll_eyes
kgdonnelly
Newbie
Posts: 3
Registered: ‎11-07-2010

Re: PHP upgrade killed my Wordpress site...

Ah, seems to have worked! Good stuff!