zipping file problem on the server PHP
- by Ahmet vardar
Hi,
here is my code;
error_reporting(-1);
require("zip_min.php");
$f = $_SERVER['DOCUMENT_ROOT'] ."/mp3/allmp3s.zip";
if (!file_exists($f)) {
$zipfile = new zipfile();
$folder = $_SERVER['DOCUMENT_ROOT'] ."/mp3;
if (is_dir($folder)) {
if($dir = opendir ($folder)) {
while (false !== ($file = readdir($dir))) {
if($file != ".") {
if($file != "..") {
$zipfile -> addFile(file_get_contents($folder."/".$file), $file);
}
}
}
closedir($dir);
$contents = $zipfile -> file();
if (file_put_contents($f, $contents)) {
print "ok";
} else {
print "error creating file";
}
}
} else {
print "error";
}
} else {
print "file already exists";
}
there are 10 mp3 files total size of 100 mb, when i execute this script, i got just a blank page, nothing happens. but with 30-40 mb of size it works great.
what should i do ?
thanks so much