[FIX] premature end of script headers problem in libperl


Nov 5, 2002
A recent WHM/CPANEL upgrade (?) seems to have broken suexec on our servers. It was most visible with all perl scripts because they were failing with the following error:

[Fri Oct 8 23:12:01 2004] [error] [client xx.xx.xx.xx] Premature end of script headers: /home/user/public_html/cgi-bin/myperlscript.cgi
/usr/local/apache/bin/suexec: error while loading shared libraries: libperl.so:
cannot open shared object file: No such file or directory

For CPANEL/WHM, it was breaking all incoming requests to /cpanel, /whm and /webmail. And unfortunately, broke our MovableType installations (since the CGI component was busted).

In any case, the problem ended up being suexec not being able to find libperl.so -- some other posts in this forum hinted at this with the following command revealing the problem:

ldd /usr/local/apache/bin/suexec

(output will indicate libperl.so cannot be found)

In our case, libperl.so was missing in /lib


  1. Other posts on this site say to disable suexec support in your apache setup.
  2. Copy or symlink /usr/local/cpanel/perl/libperl.so into /lib/libperl.so

CPANEL/WHM seems to delete /lib/libperl.so every so often, so you'll need to revisit it should it break again.

Once you replace libperl.so, run ldd again on suexec to make sure libperl is found. If it is, restart apache (service httpd stop; service httpd start) and you should be all set.


PS: Can anyone explain why this broke in the first place?