2016-11-01 10 views
0

何らかの理由で、私のPHPアップロードスクリプトを使用して動的に作成されたすべてのフォルダがパーミッション1354を取得し、その中にファイルを保存することができません。MKDIRが正しく動作しません

if(!file_exists($options['uploadDir']) && !is_dir($options['uploadDir']) 
&& mkdir($options['uploadDir'], 0750, true)) 
{ 
    $this->data['hasWarnings'] = true; 
    $this->data['warnings'] = "A new directory was created in " . 
    realpath($options['uploadDir']); 
} 
if(!is_writable($options['uploadDir'])) 
    @chmod($options['uploadDir'], 0750); 

私は何が間違っているのか分かりません。

+1

これは実際のコードですか?基底10の750は基底8の1356なので、 '0750'ではなく' 750'をあなたのコードのどこかに入れたようです。 –

答えて

0

httpサーバーのパラメータ、特にそれを実行しているユーザーのプロファイルとシステムの既定のユーザープロファイルを確認します。別の権限を強制する "umask"があるかもしれません。

phmコマンドumaskを使用してumaskを変更できます。

また、親フォルダの権限を確認し、フォルダの所有権を確認することもできます。