PHP를 사용하여 서버에 간단한 텍스트 파일을 만들려고합니다.PHP를 사용하여 우분투에 파일을 만들 수 없습니다
Warning: fopen(demo.txt): failed to open stream: No such file or directory in /var/www/code/fcreate.php on line 6 unable to create
PHP 코드는 다음과 같다 : 당신은 노력하고
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
fopen('demo.txt','r') or die('unable to create');
?>
[docs] (http://php.net/manual/function.fopen.php) ~ * 모드 'r'- 읽기 전용으로 열기; 파일 포인터를 파일의 시작 부분에 놓습니다. * – Phil
파일이 없으면 파일을 만들어야합니다. 그러나 폴더에있을 때 파일이 생성되지 않습니다. – ashwinbhy
파일이 존재하지 않고'fopen'매뉴얼 페이지에서 볼 수있는 여러 모드가 있습니다. 힌트 ~ * r *은 ** 하나도 아닙니다 ** – Phil