Forums | Mahara Community
Support
/
Upload of Profile Images doesn't work
03 January 2009, 0:25
Still unsuccessful.
Once again, i did some checks on the server:
- permissions of the data directory - correct, mahara creates a lot of stuff there
- path to file is ok
- on the command line, file -ib outputs correct mime types on image data.
- /home/mahara/artefact/internal/profileicons/no_userphoto/default/originals/0 contains a file name "0" . /usr/bin file gives the correct properties of the avatar image i tried to install ( but there should be more than one file!!!) and /usr/bin/file -ib gives a correct mime-type.
- /home/mahara/artefact/internal/profileicons/no_userphoto/default/resized contains a directory tree with varous subdirs and ONE 50x50 png file.
Any idea what's going on?
THX
Beate
03 January 2009, 5:24
Hi Beate,
<<PS: is the current beta stable enough that i might consider starting from it? >>
Mahara.org runs with Mahara 1.1beta 3 (Nigel please correct me if i tel lsomething wrong)
Nigel taught me to use on a production site only official releases.
Herzliche Grüße aus dem Schwarzwald
Heinz
03 January 2009, 8:23
Hi Heinz,
for the first steps, asl long as we are not in production, ist is possible to live without avatars - but if the community wil be online availabe on it own domain, they are definitely necessary.
I might set up another site with 1.1 in order to see if the problem persists there as well ...
Best wishes
Beate
03 January 2009, 9:47
Hi Beate,
Nigel will be back on monday and i will report him about your problem. It wolud be helpful to know exactly your settings.
Greetinge Heinz
04 January 2009, 19:42
Ok, some details in addition to those i gave before:
installation directory, everything owned by www-data:myaccount, group write permissions for everything:
/var/www/t-bc.main-ts.de
this directory holds the contents of htdocs from te 1.07 tarball.
the virtual server points to https://t-bc.main-ts.de/
it is currently open for general registration, but this will change in the near future.So everyone of the dev team is invited to register and try out themselves.
data directory
/home/mahara, owned by www-data:www-data, also with group write permission.
group write permissons on /var/www/t-bc.main-ts.de
Aside from the avatar image problem, mahara seems to work flawlessly. And again, if i try to upload an image which is too large, this is detected (and thus implicitly the correct image type as well).
Beate
04 January 2009, 21:17
Hi - one thing worth knowing would be if 'file' is able to be executed from inside PHP. If it can't then that would explain why the files can't be uploaded.
If you are able to, please check your php.ini settings to see if 'exec' is listed in the disabled functions parameter, or if safe mode is on.
If you can upload other file types ok, then you have no problems with dataroot permissions.
04 January 2009, 21:21
Hi Renate,
I'm as stumped as you (I've just registered and tried myself). But if you are willing to add a few debugging statemets to the code, we could try to narrow it down.
Edit .../artefact/internal/profileicons.php and in function upload_validate() change the lines that read:
if (!is_image_mime_type(get_mime_type($values['file']['tmp_name']))) {
$form->set_error('file', get_string('filenotimage'));
}
to:
$filepath = get_config('pathtofile');
log_debug('file command path: '.$filepath);
$filetmpname = $values['file']['tmp_name'];
log_debug('Image temporary file name: '.$filetmpname);
$mimetype = get_mime_type($filetmpname);
log_debug('Image mime type: '.$mimetype);
if (!is_image_mime_type($mimetype)) {
$form->set_error('file', get_string('filenotimage'));
}
and then edit your config.php file to send Mahara logs to your php error logs (usually your web servers logs). Then try uploading a profile image and see what you get in your logs. Maybe that could shed some light.
Iñaki.
04 January 2009, 21:14
Yes mahara.org is running 1.1 beta. And yes, you should only use the stable releases for production websites.05 January 2009, 20:03
Yes, and indeed it hangs in my setup (i tried in a parallel installation on the same server). As Your hints on 1.07 showed that my php setup has to be changed i don't find it useful to post details unless my server setup is well tuned.
Back to 1.07: Thanks for the hints with exec(). A run of phpinfo() shows:
disable_functions | exec,system,passthru,shell_exec,popen,escapeshellcmd,proc_open,proc_nice,ini_restore | exec,system,passthru,shell_exec,popen,escapeshellcmd,proc_open,proc_nice,ini_restore |
display_errors | Off | Off |
Are there any settings except enabling exec i need to change?
thx
Beate
BTW: if You like to i am willing to contribute the setup of mahara on nginx/ssl/fastcgi in an appropriate place. And if Heinz is interested, in German as well ;)
05 January 2009, 21:18
Yes, you will need to enable escapeshellcmd as well as exec (I have no idea why that would have been banned!)
Once those two are enabled, you should be able to upload files OK.
Yes instructions for nginx would be interesting, probably as a sub page of the installation instructions page (the same way the WAMP instructions are on a sub page). Thank you for the offer!