I’m trying to run Magento on a server that uses PHP4 . Therefore, I followed the instructions on using the php5-cgi. However, after placing the php5-cgi in the right directory and creating the right .htaccess file, my browser gives me the following error when surfing to the Magento root directory:
The server encountered an internal error or misconfiguration and was unable to complete your request.
I think i have the solution for the problem running php as a cgi module on a plesk server.
Plesk uses a modified version of suexec. There are some problems that can occur:
1. You simply have false permissions/owner for your “php5-cgi” in your cgi-bin (The permissions HAVE TO be set to 755, owner same as the cgi-bin’s directory user and the group HAS TO be psacln and NOT psaserv)
(That was the problem in my case)
2. An update on the server has overwritten the modified suexec version from plesk installation.
If you have root access to the server you can compare the file sizes of the two suexec executables:
ls -l /usr/local/psa/suexec/psa-suexec ls -l /usr/sbin/suexec
If they don’t match you can restore the plesk version by copying it back from plesk’s directory:
My host is running PHP 5.2.4 and I also got “Premature end of script headers” errors trying to install. I was using the downloader version and the installation instructions said set the install directory permissions to 777, however I found I needed to set them to 755 to avoid the message.
After the downloader finished I got the same message when I clicked on “continue installation”.
To resolve that I had to change the permissions on index.php to 644. I also changed the directories: app, var, media and app/etc to 755 but don’t know if that was actually necessary.
same problems here.i’m using the lastest magento.works fine after upgrated.but a few days later has the sampe problem as per the error log.i’m trying
njwood60’s aprroach,god bless me!
update:no use.so frustrated with magento.i’m thinking about stopping using it.:(
If you are getting a Premature end of script headers in Magento Backend(only) using a Plesk based Server:
Could be caused by Plesk itself if you are running php as cgi/fcgi under it. The firewall doesn’t allow the communication with the magentoserver to fetch the admin notifications, this causes trouble with some functions which are running 4min in a loop(on one of my machines) trying to get a server connection. Even rules doesn’t work in my case (yes, they are activated ). With a standard setup the fcgi max execution times will be overrun by this loop which is causing the premature end…
In my case, the site was working perfectly, except when I try to upgrade magento through Magento_Connect fron version 1.4.0.0 to 1.4.0.1. When I was trying to do it, I was allways getting premature end of script headers.
I checked the permissions of the folders and executables and everything was OK… Then I thought “well.. maybe my script is ending prematurely somehow, or not the script but the process which is supposed to receive the output of the script\”. I checked mod_fcgi documentation and used the following options:
My host is running PHP 5.2.4 and I also got “Premature end of script headers” errors trying to install. I was using the downloader version and the installation instructions said set the install directory permissions to 777, however I found I needed to set them to 755 to avoid the message.
After the downloader finished I got the same message when I clicked on “continue installation”.
To resolve that I had to change the permissions on index.php to 644. I also changed the directories: app, var, media and app/etc to 755 but don’t know if that was actually necessary.
Hope this helps someone with their install
Thanks. This was exactly what I needed to do to get it to work, though to clarify, I had to change the permissions on index.php in the magento folder, not the downloader folder.