I have a script that creates folders and files on my server, but in creating them php holds control of the files (I can't edit or update them). By viewing the source of the files, and then using unlink() I can delete the files and manually recreate them so that they are free of php's control but is there an easier way to do this? Perhaps a command I'm overlooking for releasing php's control from a created file without deleting it as unlink() does? That way the file can later be edited or updated with ease.
Here's the part of the code I'm using to create the folders and files if it helps:
mkdir("$user");
touch("$user/index.php");
These lines are followed by some simple file writing lines that build the index.php page based on user input from a form, but that's about it.
Thanks in advance,
Scott
Instead of unlink() ?
Moderator: General Moderators
chmod it
i bet if you did ls -la you'd find somthing like...
i bet if you did ls -la you'd find somthing like...
this is simple. have php cown it to youthen to modify in php, chmod it to 777 (you probalby have to do that before chowning if doing it via php) and you'll get[you@host random]$ ls -la
total 16
drwxrwxr-x 2 you you 4096 Jul 24 16:01 .
drwxr-xr-x 23 you you 4096 Aug 16 15:36 ..
-rwxr-xr-x 1 php php 1404 Jul 24 13:56 somfile
-rwxr-xr-x 1 php php 2209 Jul 24 10:48 someotherfile
[you@host random]$ ls -la
total 16
drwxrwxr-x 2 you you 4096 Jul 24 16:01 .
drwxr-xr-x 23 you you 4096 Aug 16 15:36 ..
-rwxrwxrwx 1 you you 1404 Jul 24 13:56 somfile
-rwxrwxrwx 1 you you 2209 Jul 24 10:48 someotherfile