pls help: i have apache running in cgi mode and can't see users pictures

pls help: i have apache running in cgi mode and can't see users pictures

by gabriel miranday -
Number of replies: 17
i've try all the forums and i still can't find an answer.
please. i really need your help.


thanks
gabriel.
Average of ratings: -
In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Bill Burgos -
Hello Gabriel,

You might help us by listing the Apache server version, Moodle version, platform (Linux, Windows, etc.), PHP version and MySql version.

You might also check if you have GD installed on the server. You can check this by going to the admin section:

Admin » Configuration » Variables

Look for:

gdversion:

It should read one of the following:

GD is not installed
GD 1.x is installed
GD 2.x is installed

If it is not installed, then you would not be able to see users pictures. Depending on your setup, you can install it or ask your hosting service to install it.

HTH,

Bill
In reply to Bill Burgos

Re: pls help: i have apache running in cgi mode and can't see users pictures

by gabriel miranday -
thanks for the answer.

i'm sorry because i didn't post details
the hosting service has apache running on rh-linux platform.
PHP Version 4.3.9

GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled

MySQL Support enabled Active Persistent Links 0 Active Links 1
Client API version 4.0.22 MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient

Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2634a mod_ssl/2.8.21 OpenSSL/0.9.7a PHP-CGI/0.1b

moodle has version Moodle 1.4.1 (2004083101)


i'v tried changing slasharguments but it didn't work

As you can see, PHP is running in CGI Mode.
I've asked the hosting service and they told me they had apache running with php in cgi mode, and that's why i can't see the pictures in users.

Thanks for your comments.


In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Zbigniew Fiedorowicz -
There is something wrong in either your moodle/config.php or your web server configuration file.  The images on your server are referenced as for instance as :



whereas they should be referenced as:



In reply to Zbigniew Fiedorowicz

Re: pls help: i have apache running in cgi mode and can't see users pictures

by gabriel miranday -
Thanks in advance for the participation
but i'm talking about this site

http://www.unlar.net/aula/login/index.php

try this
usr: --> moodle
pass --> moodle

the problem is this file pix.php



thanks again and i hope to solve this problem soon. smile


Gabriel

PD: Happy new Year for everybody.
In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Bill Burgos -
Gabriel,

It seems that you error is happening because of GD.

The error message indicates that GD version 1.x attempted to create the image. However, aside from that I don't know if it is installed or not.

Could you check the GD settings and confirm that it is set?

If not, then this could be one reason that the photos are not showing up.

HTH,

Bill
In reply to Bill Burgos

Re: pls help: i have apache running in cgi mode and can't see users pictures

by gabriel miranday -
in the installation section there's a message saying that GD2 is installed. i've tried in other server www.emistral.com.ar and everything works just fine.
I think the problem is php in cgi mode. and if so, i need to change the script pix.php or s.th. else.


thanks in advance.


Gabriel

PD: bill, sorry but what HTH means?



Attachment gd2.gif
In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Bill Burgos -
Gabriel,

You may want to change the setting to GD 1.x and see if it changes anything.

The reason I suggest this is because if you look at the page source of your error message (with Firefox), you will see in the header:

CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90

Which leads me to believe that GD 1.x is installed.

I doubt that php in cgi mode is the problem and would suggest exhausting all areas of configuration before going into changing the code. However, there might be someone else who can verify or confirm this.

HTH means "(I) Hope This Helps"

Bill
In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Zbigniew Fiedorowicz -
Your problem is not GD but blank lines in your config.php.
Click on --> broken images to read the relevant section of the FAQ
In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Bill Burgos -
Gabriel,

I seemed to have found out maybe why the picture does not show.

You referenced this homepage:



However, the file is not a jpeg file (jpg) but a PNG file. I am not sure how it was changed. If you rename the file to:

f1.png

You should be able to see it in your browser. Somehow, the files were named with the jpg extension.

You can double check this by uploading an image that you know works in a browser. If this is the case, you can replace the jpg image files with the proper, png image files.

Also, when you create jpeg files, it would work better by saving them in RBG mode, not CMYK mode. Saving in CMYK mode can also produce the same error message as you indicated.

I had this problem with another project on another platform (not Moodle) and since fixed it.

In addition to the config.php file mentioned, you should also look into this.

HTH,

Bill
In reply to Bill Burgos

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Zbigniew Fiedorowicz -

is not a png file.  It is a jpg file with two newlines 0x0a prepended to it.  These newlines are coming from his moodle config.php file (or from some file included by config.php). He should use configcheck.php to track down these newlines and fix it.
In reply to Zbigniew Fiedorowicz

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Bill Burgos -
You are right with the config.php and that somehow the extra lines are prepended.

However, why would it be a jpg file when it is a smiley graphic that is presented as a png file?
In reply to Bill Burgos

Re: pls help: i have apache running in cgi mode and can't see users pictures

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
I suspect the browser is ignoring the extension, because it is a JPEG file ... Moodle internally creates all those images itself from the uploaded files ... there's no way it could actually be a .png unless someone manually replaced the file.
In reply to Martin Dougiamas

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Bill Burgos -
Now I am really confused and I apologize in advance if this seems an inappropriate for this topic.

When I go to any user profile that has not uploaded their own graphic, I get the f1.png image on my browser, Firefox (right click --> Page information --> Media).



Is not this f1.png file from Moodle's own internal image files?
In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Zbigniew Fiedorowicz -
Click on the following link to the FAQ: broken images
In reply to Zbigniew Fiedorowicz

Re: pls help: i have apache running in cgi mode and can't see users pictures

by gabriel miranday -
I went to check the config.php file with tehe tester and this is the answer:

Checking url: 'http://www.unlar.net/aula/config.php' 3 extraneous characters emitted by your config.php file
The hex encodings of these extraneous characters are shown below
0x0a 0x0a 0x0a
And here is the raw unencoded output generated by your config.php


the config.php file is included in this message.

and this is the answer when i try to see the image alone from browser in this URL:


La imagen no puede mostrarse, porque contiene errores. (Image can't be shown because it contains some Errors).

What about that of CGI Mode?

In reply to gabriel miranday

Re: pls help: i have apache running in cgi mode and can't see users pictures

by Zbigniew Fiedorowicz -
Are you sure that the config.php file you attached here is an exact copy of the one used by your site?  The error message indicates that there are  3 blank lines either before the <?PHP line or after the ?> line in your config.php file (which the attached file does not have).  I checked that your lib/setup.php file does not produce an error message, so the problem must be your config.php file. If not, there is something very strange going on in your system and you should contact your service provider.

These 3 newlines are being prepended to all image files, which confuses any browser viewing your site, causing error message about images.  Also earlier this morning your config.php was emitting only 2 newlines, so you must have changed it.  Perhaps the software you are using to view/edit your config.php is adding the newlines.

PS. Your attached config.php contains the password for your mysql database.  You should change it, otherwise somebody malicious could delete or otherwise modify the contents of your moodle site. 
In reply to Zbigniew Fiedorowicz

Re: pls help: i have apache running in cgi mode and can't see users pictures

by gabriel miranday -
i don't know what's going on with this file because in spite that there's no blank lines in it, the checker script tell me that there are blank lines.
last time y copied the content of the file into a windows'  notepad file ini to be able to upload it. Now. i'm sending and exact copy of the config.php file and I assure you that i've checked the lines and there's none, but hte script tells me that there are two blank lines.
Let me tell you s.th. that i didn't mention before. When i check the files directly in the user folder, i can see the images without any problem as much f1.jpg as f2.jpg.

When I asked the service provider, they explain me that they have php in CGI mode and that's why i can't see the images. "So, you have to change your code in pix.php" they say.

Thank you very much for your participation to all of you.

Gabriel

PS: thanks for your PS