简体   繁体   中英

file not created by file handling in php

I am write following code for create demo.txt file but it not working.

<?php
$my_file = 'demo.txt';
$handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file);
?>

Cannot open file:demo.txt.

But demo.txt file already created in same directory. What thing missing here?

Check if the file under have "777" permission on every directory of the file path. It will need it to access the file. Also check you used the correct path to open

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM