While trying to build php, I kept seeing this error:


    /ctype/ctype.lo: file not recognized: File truncated

What appears to be happening is the compile process runs out of memory/swap space.

In one instance, the ctype.lo file was 1 byte. During another attempt, the file was created, but the link step failed.

To work around this, temporarily free up some memory by shutting down additional processes. For example, I stopped my web servers for a few minutes:


sudo /etc/rc3.d/S85httpd stop
make clean
sudo make install
sudo /etc/rc3.d/S85httpd start