0
votes

After executing the following commands to install and start memcached on a VPS server, I get a 500 internal server error when accessing any files from a web browser:

$ yum install memcached php-pecl-memcache perl-Cache-Memcached python-memcached
$ /etc/init.d/memcached start
$ service httpd graceful

My apache error log shows the following error every time I attempt to load a file:

Premature end of script header: <filename>

Something else that I noticed is that I'm still able to run php files from the command line without producing any errors.

Is there something else that I need to do after installing memcached on my server in order to avoid a 500 error?

2
there should be something in your http server's error logs that is useful. can you find the relevant logs and post a relevant section? - earino
@earino My apache error_log file only displays the error "[Sat Feb 22 02:09:12 2014] [error] [client X.X.X.X] Premature end of script headers: in index.php" whenever I attempt to access my website via a web browser. Is there another file that provides more robust error reporting? - Barry Beerman

2 Answers

1
votes

That error simply says that the script in your index.php was broken. It did not send any HTTP headers before the error messages. You should check your script and look for an error, which happens before sending http headers.

1
votes

I was also having the same problem and no solution found. Then i upgrade apache from WHM panel and everything was reset and start working.

I know it is not a technical solution but it works perfectly.