A solution to the PHP5, GD, libpng “Abort trap (6)” bug

My WordPress has been acting up recently, throwing mysterious “IO Error” errors every time I was trying to upload a PNG file. Upon closer examination of the Apache logs I’ve found yet another cryptic error line for every failed upload attempt:

[notice] child pid 14139 exit signal Abort trap (6)

Reinstalling the PHP5, GD and libpng failed to fix this for me, so I’ve decided to check the loading order of the PHP extensions in the extensions.ini. Indeed, the gd.so was being loaded the last. Moving the “extension=gd.so” line to the top of the list fixed this problem for me after a restart of Apache.

So give it a try before googling for the “Abort trap (6)” error like I did, the search results contained mostly mailing list noise and bug reports fixed in earlier versions of PHP.

Downloading files from the Internet using the command line on Mac OS X

The first time you try to download a file using the Terminal on Mac OS X, you’ll find out that there is no ‘wget’ or ‘fetch’ installed into the base system. Inquiring minds can find a solution after bashing their Tab key for a few near-random auto-complete guesses, but I’ll save you from that humiliating experience 🙂 Please welcome the ‘ftp’ tool. A fast visit to the man page for it will result in knowing that it’s not limited to the FTP only, and you can use it to download files over HTTP as well.

Continue reading