Page 1 of 1

fopen function is not working in "W" mode in php

Posted: Fri Jun 29, 2007 4:51 am
by hardik
hai all

when i try create new file using fopen function in php in "W" mode. it dose not create file.

Create test.php file in /var/www/html/ directory on linux machine.

past this simple code:

<?php

$fp = fopen("newfile.file", "w") or die("Couldn't create new file");

?>

through firefox browser run above file:

ip address/test.php

example : 192.168.0.115/test.php

it show Couldn't create new file means not create file.

please any one tell me step how to run this file using browser on linux.

thanks in advance :oops:

Posted: Fri Jun 29, 2007 5:03 am
by superdezign
It's not a browser issue. It's a file permissions issue. Are you sure that PHP has permissions to write to the folder that you're after?

Posted: Fri Jun 29, 2007 5:23 am
by hardik
ya

my html directory have file permission as 777

how to check the write permission of php

help me.

thanks for your reply