require_once(FULL_PATH.'/app/phpdocx/classes/CreateDocx.inc');
$docx = new CreateDocx();
$docx->addText('DOCX content');
$docx->addText('End DOCX content');
$docx->createDocx(FULL_PATH.'app/word_documents/example.docx');
The FULL_PATH is the real path to my base hosting dir.
I get the following error
Warning: ZipArchive::extractTo() [ziparchive.extractto]: SAFE MODE Restriction in effect. The script whose uid is 512 is not allowed to access app/temp owned by uid 99 in app/phpdocx/classes/CreateDocx.inc on line 1091
2012-12-12 09:21:30,761 FATAL - Error while extracting the Base Template: there may be problems writing in the default tmp folder
I have made an amendment to CreateDocx.inc to specify the exact temp location:
private function getTempDir() {
/*
Marc Comented to specify temp location
if ( !function_exists('sys_get_temp_dir')) {
function sys_get_temp_dir() {
if ($temp = getenv('TMP')) {
return $temp;
}
if ($temp = getenv('TEMP')) {
return $temp;
}
if ($temp = getenv('TMPDIR')) {
return $temp;
}
$temp = tempnam(__FILE__,'');
if (file_exists($temp)) {
unlink($temp);
return dirname($temp);
}
return null;
}
} else {
return sys_get_temp_dir();
}
*/
return 'app/temp';
}
I have even opened that folder to permissions 777, and to differant users including nobody(apache user)
Does anyone have any ideas?
Thanks
Marc