Allowed memory size of 536870912 bytes exhausted

Got a php error, Allowed memory size of 536870912 bytes exhausted. It is quite strange, because I created a php info file to check the settings.

The setting of the server is memory_limit 12288M (server got enough free RAM).

What am I missing? Is there a other setting that is set to the 512MB?

Error:

PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 53248 bytes) in /lib/Varien/Image/Adapter/Gd2.php on line 74