Forums | Mahara Community

Support /
Export portfolio not working


anonymous profile picture
Account deleted
Posts: 18

05 September 2011, 18:44

Could somone please help me. I've tried so many things. The export portfolio option is giving me "Failed to zip the export file"

I'm on a shared (gs) Media Temple server. I followed these instructions to install zip for Linux server : http://wiki.mediatemple.net/w/(gs):Install_Zip_for_PHP_5 In the PHP5 info I can see the Zip extension, meaning it was installed successfully

In the config.php i have tried $cfg->pathtounzip (and zip) = 'usr/bin/zip' (and zip.exe) as well as $cfg->pathtounzip = '/home/XXXXX/data/lib/php/zip.so' 

I have also tried commenting out the following in export/index.php:

if (!is_executable(get_config('pathtozip')))
{    log_info("Either you do not have the 'zip' command installed, or the config setting 'pathtozip' is not pointing at your zip command."        . " Until you fix this, you will not be able to use the export system.");   
die_info(get_string('zipnotinstalled', 'export'));}

Any help would be greatly appreciated.

François Marier's profile picture
Posts: 411

05 September 2011, 21:59

Hi Mike,

Your config.php is not pointing to the right tools.

  "$cfg->pathtounzip" needs to point to something like '/usr/bin/unzip'

  "$cfg->pathtozip" needs to point to something like '/usr/bin/zip'

And of course, both of these UNIX utilities must exist on the system. Try checking with this:

  ls -l /usr/bin/unzip

  ls -l /usr/bin/zip

Note that this is different from the PHP Zip extension. You need both for Mahara.

Cheers,

Francois

Mary Cooch's profile picture
Posts: 135

10 September 2011, 7:08

Hi there. I am a bit lost with this too. I got a similar error message when exporting from Moodle 2.1 to Mahara 1.4 along the lines of  Cannot find unzip executable and I contacted my webhost who said (I quote)

Unzip is located in /usr/bin directory:

-bash-3.2# hostname
moodlefairy.vps.ourlinuxnetwork.com
-bash-3.2# which unzip
/usr/bin/unzip
-bash-3.2#

Would someone please simply type out for me exactly what I am meant to add to my config.php file please? I can't see anything in there about pathtounzip or zip . I don't understand php but I will happily copy and paste someone else's code Smile

ps: My guess is:

$cfg->pathtounzip   = '/usr/bin/unzip';
$cfg->pathtozip   = '/usr/bin/zip';

Is that right?


François Marier's profile picture
Posts: 411

11 September 2011, 21:41

Hi Mary,

Your guess looks right to me.

Cheers,

Francois

Mary Cooch's profile picture
Posts: 135

12 September 2011, 1:14

Thanks. Unfortunately it hasn't made any difference - I still get the same error message. I will have think of something else..

anonymous profile picture
Account deleted
Posts: 18

12 September 2011, 2:48

Still unresolved. Can't use the export function on a (gs) Media Temple shared server.

Zip extension showing installed and enabled in php_info under PHP version 5.2

Tried every combination of these in the config file:

$cfg->pathtounzip = '/home/xxxx/data/lib/php/zip.so'; (yes I replaced the xs with my server)

$cfg->pathtozip   = '/home/xxxx/data/lib/php/zip.so';

$cfg->pathtounzip   = '/usr/bin/unzip';

$cfg->pathtozip   = '/usr/bin/zip';

When I use $cfg->pathtounzip = '/home/xxxx/data/lib/php/zip.so'; I can choose the files to export but it returns as failed to export. When I try to use $cfg->pathtozip   = '/usr/bin/zip'; it says I do not have the zip extension installed.

Seems I am getting the same sort of Zip extension problem over at Moodle now too. I am trying to upgrade to Moodle 2.1. PHP 5.3 is supposed to have the Zip extensions included but I am not showing the extensions enabled in php_info. 

I'm sitting and hoping the gods of support can lead me to remedy this situation. I have 10 people who would like to get their portfolios. Help...pleeaase.

Mary Cooch's profile picture
Posts: 135

12 September 2011, 11:01

Two answers in one here:

(1) My problem is now resolved thanks to my host who added the path to unzip and zip executables to my VPS open_base_dir variable (server configuration file). (I am copying and pasting there as I don't really understand that!!)

(2) Your problem  Mike: I spent a lot of time on a Mediatemple server trying to help a friend set up Moodle 2.1. Even though we could change the php version to the required 5.3 we couldn't get the zip extensions and after a lot of effort were told they don't do that -end of - If I can find the email with their full answer I will paste it here but basically the friend moved hosts.Frown

EDIT  (found the support email) The zip can only be installed on php 5.2 because that is their default so even though you can upgrade to 5.3 you can't have the zip with 5.3 because they haven't put that option in place yet and hence can't run Moodle 2.1

anonymous profile picture
Account deleted
Posts: 18

12 September 2011, 19:37

Thank you so much Mary. You hit the nail on the head. I've been having trouble with Media Temple's (gs) service for years. I think it's definitely time to move on. 

François Marier's profile picture
Posts: 411

12 September 2011, 20:39

For the benefit of others who may stumble upon this thread, "pathtozip" and "pathtounzip" must point to executable binaries, not shared libraries (like zip.so).

So these settings are definitely not going to work, even if they allow you to bypass some of the checks:

  $cfg->pathtounzip = '/home/xxxx/data/lib/php/zip.so';

  $cfg->pathtozip   = '/home/xxxx/data/lib/php/zip.so';

The PHP Zip extension is a separate thing that just needs to be installed on the server, no need to add anything in config.php for that.

Cheers,

Francois

Dan Tina's profile picture
Posts: 20

05 October 2012, 5:47

Hi,

In addition and in case this helps anyone, check that you are not adding .exe to zip / unzip when specifying $cfg->pathtounzip and $cfg->pathtozip in config.php (assuming your Mahara installation is on Ubuntu / Linux).  You should have it as follows:

$cfg->pathtounzip = '/usr/bin/unzip';
$cfg->pathtozip   = '/usr/bin/zip';

Dan

10 results