Ben yüklenen bir dosyayı açmak için PHP kullanırken sorun yaşıyorum. Ben ince yükleyebilirsiniz,. Zip onun gerekiyordu nereye kopyalanır alır, ama halletmek değil. Dizin ve zip düzgün 777 chmod'd ediliyor apache hata günlükleri sadece "Hata: [whateverfile] oluşturulamıyor" göstermektedir.. Zip her dosya için. Herhangi bir fikir neden bu olur? Takdir! Bu stackoverflow at üzerinde aitse söyle, ama bir apache / os / somethingelse sorun gibi görünüyor olun. Kod şöyle:
<?php
$target_path = "/home/someuser/hostgames/";
mkdir($target_path . basename($_FILES['uploadedfile']['name'],".zip") . "/",0777);
chmod($target_path . basename($_FILES['uploadedfile']['name'],".zip") . "/",0777);
$target_path =$target_path . basename($_FILES['uploadedfile']['name'],".zip") . "/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
echo "<br/>Path is: $target_path<br/>";
echo "<br/>Command is: unzip $target_path<br/>";
shell_exec("chmod 777 $target_path");
shell_exec("unzip $target_path");
?>