No Pictures allowed after 1.0.8 upgrade

No Pictures allowed after 1.0.8 upgrade

Mark Smith發表於
Number of replies: 7
1.0.8 upgrade eliminated the possibility of adding pix for the user.
評比平均分數: -
In reply to Mark Smith

Re: No Pictures allowed after 1.0.8 upgrade

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
Check your admin configuration variables. If GD is switched off, or not available, then the upload form is now hidden to avoid confusing students.
In reply to Martin Dougiamas

Re: No Pictures allowed after 1.0.8 upgrade

Mark Smith發表於
It is apparently switched off or not available.  I assume that GD is something for php???  THere is nothing in the phpinfo file about GD.  What makes it available?  I am running RH 7.3, if that matters.  Also, it is 1.0.8.1 that I have installed.  I did a search for GD, but the list at the command prompt was a bit long.  Any suggestions??  thoughtful.gif
In reply to Mark Smith

Re: No Pictures allowed after 1.0.8 upgrade

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
PHP 4.3.0 includes GD (previously it was an external library) and is better anyway, so if you like RPMs then perhaps this will help:

http://www.aucs.org/rpmcenter/details/php-4.3.0/php-4.3.0-1.8.0.i386.rpm.html

otherwise download the source and configure it like this:

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

Cannot upload user pictures

Steven Williams發表於

 hi, all:

I'm not sure if this is a version 1.0.8 problem or not. I finally got around to upgrading our server to:

server OS: Redhat 7.3
PHP 4.3.0 with gd support
Moodle 1.0.8

Everything is fine as far as moodle install is concerned. I'm even getting site variables to show that gd 2.0 is installed. I can confirm that, too, by a check of phpinfo() which shows:

GD Support: enabled
GD Version: bundled (2.0 compatible)
GIF Read Support: enabled
PNG Support: enabled
WBMP Support: enabled

So far, so good...

However, when I actually attempt an upload of a user picture, I get the following error message:

Fatal error: Call to undefined function: imagejpeg() in /home/users/~learn/public_html/user/lib.php on line 163

BTW: line 163+ snippet shows:

    if (ImageJpeg($im1, "$CFG->dataroot/users/$userid/f1.jpg", 90) and
        ImageJpeg($im2, "$CFG->dataroot/users/$userid/f2.jpg", 95) ) {
        chmod("$CFG->dataroot/users/$userid/f1.jpg", 0666);
        chmod("$CFG->dataroot/users/$userid/f2.jpg", 0666);
        return 1;
    } else {
        return 0;
 
   }

Any clues as to what might need fixing?

PS: Thanks Martin and team for an incredible piece of programming. Moodle is coming to the world just as it looked like proprietary giants like Blackboard were about to attempt to gobble major portions of the K-12 landscape.

best,

stevewil@glo.org
http://learn.glo.org
http://www.glo.org

In reply to Steven Williams

Re: Cannot upload user pictures

Dr. Prin Singhanart發表於
i had this problem before what you need to do is compile PHP with this command --with-jpeg-dir=/usr/lib ... once done that you should see from phpinfo() this line.

JPG Support enabled

Then...the world of joy!!



In reply to Dr. Prin Singhanart

Re: Cannot upload user pictures

Steven Williams發表於

Thanks much, M minkowski: Your suggestions have delivered nearly full world of joy. We recompiled php using these attributes as per your and Martin's suggestions:

./configure \
--with-mysql=/usr/local/mysql \
--with-xml \
--with-apache=../apache_1.3.27 \
--enable-track-vars \
--enable-trans-sid \
--with-gd \
--with-jpeg-dir=/usr/lib \
--with-gif-dir=/usr/lib \
--with-zlib-dir=/usr/lib

No issues occurred all the thru to Apache make install.

phpinfo() gd reports:

GD Support enabled
GD Version bundled (2.0 compatible)
GIF Read Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

That looks pretty good, I think, since GIF, JPG and PNG appear to be enabled.

However, when we attempt upload of JPGs, we get all black image. When we attempt GIF image upload, no problem. So GIFs are OK, JPGs still have problems.

Now, to add one more layer of weirdness to the image upload issue, I find that if I try to upload a GIF to Martin's moodle.com server, I get the same issue as I get when I try to upload a JPG to my server: the image appears black. However, JPGs uploaded on Martin's server are no problem.

Anybody have any clues about this?

In reply to Steven Williams

Re: Cannot upload user pictures

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
Can you visit the admin "Variables" page and make sure that you have "gdversion" set to "2", and try uploading a JPG again?

If that doesn't work, you might want to change /usr/lib to /usr in the PHP compilation ... that's what I used on my Redhat 7.3 box.