2016-06-14 7 views

답변

0

당신은 심포니 파일 시스템 구성 요소에서 아파치 사용자

HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` 

sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" /etc/apache2/sites-available/ 
1

에 쓰기 권한을 추가 /etc/apache2/sites-available/의 권한을 변경해야

public function touch($files, $time = null, $atime = null) 
{ 
    foreach ($this->toIterator($files) as $file) { 
     $touch = $time ? @touch($file, $time, $atime) : @touch($file); 
     if (true !== $touch) { 
      throw new IOException(sprintf('Failed to touch "%s".', $file), 0, null, $file); 
     } 
    } 
} 

당신이 볼 때, touch() 방법을 PHP의 빌드 인 touch()을 둘러싼 단순한 래퍼 일뿐입니다. sudo를 통해 높은 권한으로 터치해야하는 경우 직접 전화해야합니다.

shell_exec('sudo touch ' . escapeshellarg($file)); 
관련 문제