0
私は、サブディレクトリ内の新しいメンバのためにいくつかのPHPファイルを生成するWebアプリケーションを持っていますが、PHPコピー機能を使用していますが、メンバWebページは500 Internal Server Errorスクリプトは、FTP、ホスティングアカウント、またはルートアカウントでアップロードされた場合、問題なく動作しています。PHPコピー機能とApacheグループ
「root root」グループのファイルをアップロードした後、ファイルが正常に動作しているため、「apache apache」グループに問題があると思います。
これはユーザーのものに私のディレクトリ内の全ファイルをコピーする機能です。
function smartCopy($source, $dest, $options=array('folderPermission'=>0775,'filePermission'=>0775))
{
$result=false;
if (is_file($source)) {
if ($dest[strlen($dest)-1]=='/') {
if (!file_exists($dest)) {
cmfcDirectory::makeAll($dest,$options['folderPermission'],true);
}
$__dest=$dest."/".basename($source);
} else {
$__dest=$dest;
}
$result=copy($source, $__dest);
chmod($__dest,$options['filePermission']);
} elseif(is_dir($source)) {
if ($dest[strlen($dest)-1]=='/') {
if ($source[strlen($source)-1]=='/') {
//Copy only contents
} else {
//Change parent itself and its contents
$dest=$dest.basename($source);
@mkdir($dest);
chmod($dest,$options['filePermission']);
}
} else {
if ($source[strlen($source)-1]=='/') {
//Copy parent directory with new name and all its content
@mkdir($dest,$options['folderPermission']);
chmod($dest,$options['filePermission']);
} else {
//Copy parent directory with new name and all its content
@mkdir($dest,$options['folderPermission']);
chmod($dest,$options['filePermission']);
}
}
$dirHandle=opendir($source);
while($file=readdir($dirHandle))
{
if($file!="." && $file!="..")
{
if(!is_dir($source."/".$file)) {
$__dest=$dest."/".$file;
} else {
$__dest=$dest."/".$file;
}
//echo "$source/$file ||| $__dest<br />";
$result=smartCopy($source."/".$file, $__dest, $options);
}
}
closedir($dirHandle);
} else {
$result=false;
}
return $result;
}
お知らせ:パーミッションに問題はありません。
あなたはどのようなエラーが出るのですか?権限エラーの場合、500エラーは実際には意味をなさない。 Apacheのエラーログにアクセスできますか? –
yup、500エラー、私はサーバーの所有者です。 – Hamza
そして、ログは何を言わなければならないのですか? –