Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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?
gd
Do you already have enable/installed gd extension? If not, you have to install it. You can add it in composer.json( "ext-gd": "*" )
Add a comment
Try using \imagecreatefromjpeg (from global namespace)
\imagecreatefromjpeg
Required, but never shown
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.
Explore related questions
See similar questions with these tags.
gdextension installed? Looks like this function doesn't exist in global scope, which is why php attempts to load it from current namespace.