Getting error in php editor

The library shouldn't be missing if you installed Fusion using the recommended installer on a clean install of the recommended operating system. But to answer your question:

Assuming you are running Debian as your OS the standard method would be...
If you are logged in as root just run:
apt-get install php-gd
or, if non root:
sudo apt-get install php-gd

But be aware, I believe that Fusion uses different php source than the standard Debian packages.