을 사용하여 파일을 만들 수 없습니다
Warning: file_put_contents(stats/stats.html) [function.file-put-contents]: failed to open stream: Permission denied in /home/jtf/public_html/index.php on line 2
폴더 통계를 777
무엇 내가 틀렸어?
감사
을 사용하여 파일을 만들 수 없습니다
Warning: file_put_contents(stats/stats.html) [function.file-put-contents]: failed to open stream: Permission denied in /home/jtf/public_html/index.php on line 2
폴더 통계를 777
무엇 내가 틀렸어?
감사
/stats
및 stats
(또는 동등한 ./stats
)은 (사실 그들은 단지 이론적으로 같은 디렉토리를 참조 수) 반드시 같은 디렉토리하지 않습니다. 현재 존재하지도 않는 디렉토리에 현재 쓰려고합니다.
file_put_contents('stats/file.html',$txt); // removed "/" prefix
이 시도 :
$txt = file_get_contents('http://stats.pingdom.com/file');
file_put_contents(dirname(__FILE__) . '/stats/file.html', $txt);
경로 점을 /
대신 /home/jtf/public_html/
에 그냥 ../
을 사용하여 더 /stats/
폴더가에 없다 루트 디렉토리 서버에, 나는 믿습니다.
경로는 /home/jtf/public_html/
입니다. 이 파일을 사용하여 웹 서버의 문서 루트에있는 파일을 처리해야합니다.
OP는이 대답을 올바른 것으로 표시해야합니다. TYVM Jon – loostro
나는 당신이 다음과 같은 말을 믿는다 : "이것이 작동해야한다 [stats 디렉토리가 존재한다면]" –