Forums | Mahara Community

Open Discussion /
Export fail on Mahara 1.7


anonymous profile picture
Account deleted
Posts: 7

31 May 2013, 8:09

Hi all,

When I try to export a HTML (or Leap) portfolio it never actually produces a file. I checked with my hosting provider who tell me that all the requried PHP ZIP extentions are enabled. This is my log file:

[30-May-2013 19:42:06 UTC] * log_message("Undefined variable: returnvar", 8, true, true, "/home/schoolmu/public_html/mahara/export/html/lib....", 244) at /home/schoolmu/public_html/mahara/lib/errors.php:446
[30-May-2013 19:42:06 UTC] * error(8, "Undefined variable: returnvar", "/home/schoolmu/public_html/mahara/export/html/lib....", 244, array(size 25)) at /home/schoolmu/public_html/mahara/export/html/lib.php:244
[30-May-2013 19:42:06 UTC] * PluginExportHtml->export() at /home/schoolmu/public_html/mahara/export/download.php:105
[30-May-2013 19:42:06 UTC] 
[30-May-2013 19:42:29 UTC] [WAR] f8 (export/html/lib.php:244) Undefined variable: returnvar
[30-May-2013 19:42:29 UTC] Call stack (most recent first):
[30-May-2013 19:42:29 UTC] * log_message("Undefined variable: returnvar", 8, true, true, "/home/schoolmu/public_html/mahara/export/html/lib....", 244) at /home/schoolmu/public_html/mahara/lib/errors.php:446
[30-May-2013 19:42:29 UTC] * error(8, "Undefined variable: returnvar", "/home/schoolmu/public_html/mahara/export/html/lib....", 244, array(size 25)) at /home/schoolmu/public_html/mahara/export/html/lib.php:244
[30-May-2013 19:42:29 UTC] * PluginExportHtml->export() at /home/schoolmu/public_html/mahara/export/download.php:105

Any ideas? Mahara installation was made using Softaculous installer.

Thanks, Steve

Aaron Wells's profile picture
Posts: 896

31 May 2013, 10:29

Hi Stephen,

The error message you're seeing (undefined variable $returnvar on line 242 of export/html/lib.php) is where Mahara checks to see the result it got from trying to run the command-line zip executable to zip up the archive.

By default Mahara expects the zip and unzip utilities to be at /usr/bin/zip and /usr/bin/unzip . You can override that by adding $cfg->pathtozip and $cfg->pathtounzip directives in config.php, like so:

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

But first you'll need to find out the correct path to them. ;) If you're using Softaculous it sounds like you're probably on shared hosting, so ask your host provider for the paths. It may be in an FAQ on their website, as quite a few web apps require this info.

Cheers,
Aaron

anonymous profile picture
Account deleted
Posts: 7

04 June 2013, 10:20

Hi Aaron,

You were right, The hosting company was using another root folder address. I changed it, the files now export on the maharadata directory but still no download of ZIP. Spotted in the log that exec() can't run due to "security issue." Seems that some hosting providers disable it. Will get back onto my hosting provider. Thanks again for help.

Steve

Aaron Wells's profile picture
Posts: 896

04 June 2013, 18:09

Good luck! Maybe they'll let you put a copy of the zip & unzip utilities in your web directory?

Alternatively, if your server has the PHP zip extension installed, in theory you could hack Mahara to use that instead of command-line zip.

Cheers,
Aaron

4 results