My guess is you have multiple copies of PHP. You and root use one built with GD, cron uses another due to PATH
environment variable inconsistencies.
As a working user (you or root), run
which php
That will give you a full path like /usr/bin/php
. Use that path in your cron entry, eg
0 0 * * * /usr/bin/php /path/to/your/script.php