Jpeg not supported on this server, PHP config options?

Jpeg not supported on this server, PHP config options?

by Lauri Ojansivu -
Number of replies: 6

Hi,
my hosting server's PHP is configured as CGI with following options

Configure Command './configure' '--without-apache' '--with-config-file-path=/usr/local/lib/phpcgi' '--with-mysql' '--with-gd' '--with-jpeg' '--with-zlib'

And GD options currently are:

GD Support enabled
GD Version bundled (2.0.15 compatible)
GIF Read Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled

I'm getting error "JPEG not supported on this server." When I try to upload user photo.

Uploading PNG gives error:
"Fatal error: Call to undefined function: imagejpeg()  /home/.../moodle/user/lib.php on line 162"

What are the correct Configure options for PHP that must be included for Moodle to work right? And so that extensions work too? So that I can compile it correctly. smile

- Lauri

Average of ratings: -
In reply to Lauri Ojansivu

Re: Jpeg not supported on this server, PHP config options?

by Lauri Ojansivu -
PHP compile options should be included in installation guides so I consider this as a bug in documentation. I have searched Moodle forums and still not found answer for this. Could someone from for example Moodle.org site tell me what PHP compile options they use to get all needed features like adding jpeg images working, please?

Best Regards,
Lauri
In reply to Lauri Ojansivu

Re: Jpeg not supported on this server, PHP config options?

by Floyd Collins -
Main menu -> Moodle Documentation -> Installation

All you realy need is right there.

Or Main menu -> Moodle Documentation -> Apache, MySQL, PHP 
In reply to Floyd Collins

Vast: Re: Jpeg not supported on this server, PHP config options?

by Lauri Ojansivu -
Well there are docs for installing from rpm, but I need help with installing from source. The docs say that following are needed:

* GD library turned ON, with support for JPG and PNG formats
* zlib library turned ON (if you want to use backup/restore on Windows)
* Sessions support turned ON
* File uploading turned ON
* Safe Mode must be turned OFF (see the forums on moodle.org for problems caused by Safe Mode)

And hosting service:s current PHP has configure options (and they allow installing my own PHP from source but not rpm):
'./configure' '--without-apache' '--with-config-file-path=/usr/local/lib/phpcgi' '--with-mysql' '--with-gd' '--with-jpeg' '--with-zlib'

So there already is --with-jpeg included, but it didn't show in GD options, why? I'm not very familiar with all needed options and compiling in general, I guess it's something like "--with-zlib --with-png" etc but I'm not sure. Where are the compile options for PHP listed?

Best Regards,
Lauri
In reply to Lauri Ojansivu

Re: Vast: Re: Jpeg not supported on this server, PHP config options?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Well, this is a string that has worked for me on a Redhat 9.0 system.  I'm pretty sure you need to add the -dir paths.  Hope it helps.

./configure --with-mysql  --enable-track-vars --enable-trans-sid --with-gd --with-jpeg-dir=/usr --with-ttf --with-zlib-dir=/usr  --with-freetype-dir=/usr --with-apxs2=/usr/sbin/apxs


In reply to Martin Dougiamas

Re: Vast: Re: Jpeg not supported on this server, PHP config options?

by Jason Mitchell -
Assimung you have shell access (and appropriate rights) you can look at the php configure options with ./configure --help - you will have to be in the right location.

The Right Location
If this is a FreeBSD box, look in the php-4.3.4 port directory /usr/port/ww/php-4.3.4/. If this is a Linux box where you untarred the PHP download will be where you configure the compile. I do not use RPM so I have no idea where the RPM gets placed.

I have used Moodle on two different boxes, one is a debian the other FreeBSD. The debian configure string is as follows (you will have to remove the apostrophes if you use this).

'../configure' '--prefix=/usr' '--with-apxs=/usr/bin/apxs' '--with-regex=php' '--with-config-file-path=/etc/php4/apache' '--disable-rpath' '--enable-memory-limit' '--disable-debug' '--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db4' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--enable-dbase' '--enable-dbx' '--with-gettext' '--enable-mbstring' '--with-mime-magic' '--with-pcre-regex' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--enable-tokenizer' '--disable-xml' '--with-expat-dir=/usr' '--enable-yp' '--with-zlib' '--without-pgsql' '--with-kerberos=/usr' '--with-openssl=/usr' '--with-exec-dir=/usr/lib/php4/libexec' '--disable-static' '--with-curl=shared,/usr' '--with-dom=shared,/usr' '--with-dom-xslt=shared,/usr' '--with-dom-exslt=shared,/usr' '--with-zlib-dir=/usr' '--with-gd=shared' '--with-jpeg-dir=shared,/usr' '--with-xpm-dir=shared,/usr/X11R6' '--with-png-dir=shared,/usr' '--with-freetype-dir=shared,/usr' '--with-mcrypt=shared,/usr' '--with-gmp=shared,/usr' '--with-imap=shared,/usr' '--with-imap-ssl' '--with-ldap=shared,/usr' '--with-mcal=shared,/usr' '--with-mhash=shared,/usr' '--with-mm' '--with-mysql=shared' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-pgsql=shared,/usr' '--with-recode=shared,/usr' '--with-pfpro=shared,/opt/payflowpro' '--enable-xslt=shared' '--with-xslt-sablot=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-sybase-ct=shared,/usr' '--with-ttf=shared,/usr' '--with-t1lib=shared,/usr'

I do not use the gd library on the FreeBSD box, so I do not have the --with-jpeg --with-zlib --with-png --with-gd options installed.

Windows/IIS (not Windows/Apache)
If this is windows, you will have to go to the php.ini and uncomment the modules pertaining to gd, php, png, etc for full image support, and then restart IIS.

I do not use Apache on Windows so I can't really help anyone with that...

Hope this helps.

J.



In reply to Lauri Ojansivu

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.