0

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?

1
  • 1
    Do you have gd extension installed? Looks like this function doesn't exist in global scope, which is why php attempts to load it from current namespace. Commented Oct 8, 2019 at 11:27

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

1

Try using \imagecreatefromjpeg (from global namespace)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.