Premature end of script headers

If you receive an Internal Server Error 500 and checking your log files displays "Premature end of script headers" errors this can occur for a couple reasons.

This can represent a permission issue. If using PHP be sure to set your .php files to 755 with our service.

Coding Issue: You have an extra space or carriage return in your coding after the closing of the ?php tag.

Your script has exceeded resource usage limits. This can occur if your script is using over 128MBs in a single process. After the 128MB the process is killed due to excessive resource usage which results in the internal server error and a premature end of script headers listing in the error logs. To prevent this from occurring you will want to optimize your coding to be more efficient and use less memory via optimization, reducing features, pruning databases, or upgrading your plan to a plan better suited to the high memory demands your account requires such as the semi-dedicated plan or higher.


Share this page:


Was this article useful? Have any suggestions or improvements to the information?

Also Read

Running a PHP file with a cron job

To run a PHP file from cron, use the "cron jobs" section of your control panel. Use the following...

Error 500 - Internal Server Error - PHP

This can be due to several factors. The first thing to check is that the permissions on the file...

How to Disable XCache for a Domain

On many of our servers xcache is use as part of the php caching mechanism. If you are...

Changing Maximum Upload Size

Firts check your control panel for the "PHP Options" icon. If available you can change the PHP...

Test MySQL Connection

The following is a great way to verify a MySQL / MariaDB database connection issue. Create a file...