Forums | Mahara Community
Mahara/Moodle integration
/
Error while exporting content to Mahara
23 November 2010, 7:43
Hi everybody:
I have a Moodle 2.0 and Mahara 1.3 integrated via SSO installation.
The SSO works fine, but I´m having some trouble while trying to export content to Mahara.
I get this error while trying to save a forum post to Mahara:
"Failed to start communication with remote server: remote server error: code: , message: Cannot find unzip executable"
Any ideas welcome.
Thanks in advance!
Tom
23 November 2010, 13:07
Hi Tomas,
as I've told you in the Spanish forum (I'm reposting it here in case someone else has the same problem in the future ;-), you need to install a unzip (and ideally zip too) executable in your Mahara server. A command line zip/unzip, not something like Winzip, 7zip, etc. And tell Mahara the path of both of them, in config.php with the options
$cfg->pathtounzip = '.....'; // absolute path to unzip executable
$cfg->pathtozip = '......'; // absolute path to zip executable
Saludos.
Iñaki.
23 November 2010, 15:39
Iñaki,
Thanks for your response, the problem is that my config.php file does not have those paths.
Nevertheless I added them to both Moodle and Mahara config.php file and made a web server restart with no results at all.
P.D.: I have Moodle 2 in the server, maybe the procedure is different?
P.D.2: I see in my /usr/bin folder both the zip and unzip utilities.
Cheers!
Tomas
23 November 2010, 17:47
Tomas,
those config values are not in config.php, but you can find them in lib/config-defaults.php. By the way, you only need to add them in Mahara's config.php
In fact, their default values are /usr/bin/unzip and /usr/bin/zip (the usual Unix/Linux path for those utilities)
Mahara just checkts that the paths specified in those settings correspond to executable files (i.e., we can execute them). If they don't, then the error is shown.
Thus, if you actually have the /usr/bin/unzip and /usr/bin/zip binaries, we just need to check that they are executable by the web server user.
In addition to checking the file permissions (and those of /usr and /usr/bin directorios), you should check whether your operating system is using something like SELinux or AppArmor (and Ubuntu Server 10.10 does by default). If it does, then you should check the configuration of those systems to see if the web server user (or the service, depending on the tool) is allowed to execute /usr/bin/unzip and /usr/bin/zip.
Saludos.
Iñaki.
28 November 2010, 18:09
Iñaki:
- /usr
- /usr/bin
Have this privileges drwx-rwx-rwx
and
- /usr/bin/zip
- /usr/bin/unzip
Have this privileges:
-rwx-rwx-rwx
I gues that with those values both the directories and files should be executed.
Is there a way to check if I have SeLinux or AppArmor installed in my server?
Thanks!
Tomas
29 November 2010, 10:15
You can check if you have AppArmor installed and enabled in your system by executing the following command as root:
/usr/sbin/apparmor_status
You could get something more or less similar to this if you have it installed and enabled:
apparmor module is loaded. 5 profiles are loaded. 5 profiles are in enforce mode. /sbin/dhclient3 /usr/lib/NetworkManager/nm-dhcp-client.action /usr/lib/connman/scripts/dhclient-script /usr/sbin/mysqld /usr/sbin/tcpdump 0 profiles are in complain mode. 1 processes have profiles defined. 0 processes are in enforce mode : 0 processes are in complain mode. 1 processes are unconfined but have a profile defined. /usr/sbin/mysqld
You can check if SELinux is installed and enabled by executing the following command as root:
sestatus
If installed and enabled you would get something similar to this:
SELinux status: enabled SELinuxfs mount: /selinux Current Mode: permissive Policy version: 16
You should consult AppArmor or SELinux documentation to allow the web server execute /usr/bin/unzip if you have any of them installed.
Saludos.
Iñaki.
05 October 2012, 5:44
Hi,
In case this helps anyone, this was resolved for me by simply making sure when specifying $cfg->pathtounzip and $cfg->pathtozip in config.php (assuming your Mahara installation is on Ubuntu / Linux), I didn't add the .exe extension for zip / unzip. You should have it as follows:
$cfg->pathtounzip = '/usr/bin/unzip';
$cfg->pathtozip = '/usr/bin/zip';
Dan