Symfony 3 - Using imagecreatefromjpeg in controller gives an error

638 Views Asked by At

I am using Symfony 3 and when I try to use imagecreatefromjpeg function in PHP it gives the following error.

Attempted to call function "imagecreatefromjpeg" from namespace "AppBundle\Controller"

How can I fix this?

2

There are 2 best solutions below

0
On

Do you already have enable/installed gd extension? If not, you have to install it. You can add it in composer.json( "ext-gd": "*" )

0
On

Try using \imagecreatefromjpeg (from global namespace)