undefined function: imagecreatefromjpeg()

undefined function: imagecreatefromjpeg()

par Mohd Radzi Abdul Kadir,
Nombre de réponses : 3
When I try to edit user profile I get an error msg "Fatal error: Call to undefined function: imagecreatefromjpeg() in moodle/user/edit.php on line 65"

Any idea why?
Moyenne des évaluations  -
En réponse à Mohd Radzi Abdul Kadir

Re: undefined function: imagecreatefromjpeg()

par Martin Dougiamas,
Avatar Core developers Avatar Documentation writers Avatar Moodle HQ Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers
Your PHP server doesn't have GD installed.

Go to your admin "Configure variables" page and check the default setting for GD there ... it will probably say "GD is not installed".

You need to recompile/reinstall PHP with GD support.

This reminds me to add an error check for that case on the user profile page.

Cheers,
Martin
En réponse à Martin Dougiamas

Re: undefined function: imagecreatefromjpeg()

par Mohd Radzi Abdul Kadir,
I already install GD now and I still get the same error msg.

In my phpinfo I get
GD Support -enabled
GD Version -between 1.3 and 1.6.1
GIF Read Support -enabled
GIF Create Support -enabled

En réponse à Mohd Radzi Abdul Kadir

Re: undefined function: imagecreatefromjpeg()

par Martin Dougiamas,
Avatar Core developers Avatar Documentation writers Avatar Moodle HQ Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers
When compiling PHP, in addition to --with-gd, you also need --with-jpeg-dir to include the JPEG libraries (and --with-png-dir for PNG support).

Just in case it's helpful, this is my full PHP configure line on a Redhat server:

./configure --with-gd=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql --with-pgsql=/usr --enable-track-vars --enable-trans-sid --with-ttf --with-zlib-dir=/usr --with-xpm-dir=/usr/X11R6 --with-freetype-dir=/usr --with-apxs=/opt/bin/apxs

Cheers,
Martin