yolop Posted November 20, 2008 Share Posted November 20, 2008 i do that <?php copy('1.php','5.php' ); ?> it's work but after the file copy i tried to edit this file and i get the error Unable to open 5.php for writing i can't edit him why? i want to edit please thank Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/ Share on other sites More sharing options...
premiso Posted November 20, 2008 Share Posted November 20, 2008 chmod You need to change the file permissions to allow writing. By default the permissions are I think 644, which allows reading but no writing. Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694477 Share on other sites More sharing options...
yolop Posted November 20, 2008 Author Share Posted November 20, 2008 chmod You need to change the file permissions to allow writing. By default the permissions are I think 644, which allows reading but no writing. witch permissions i need to get??? Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694484 Share on other sites More sharing options...
yolop Posted November 20, 2008 Author Share Posted November 20, 2008 if i put 0750 or 0600i event can't open the file and 0644 and 0755 same problem'i cant edit the file Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694486 Share on other sites More sharing options...
premiso Posted November 20, 2008 Share Posted November 20, 2008 I know 0777 will give you full access, but after you are done writing to it I would reset it back to 644. Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694490 Share on other sites More sharing options...
yolop Posted November 20, 2008 Author Share Posted November 20, 2008 I know 0777 will give you full access, but after you are done writing to it I would reset it back to 644. with http://il2.php.net/chmod it's impassable to put 0777 Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694494 Share on other sites More sharing options...
yolop Posted November 20, 2008 Author Share Posted November 20, 2008 and the function copy return error Warning: chmod() [function.chmod]: open_basedir restriction in effect. File(book.php) is not within the allowed path(s): (/home/****/:/tmp:/usr/local/lib/php/) whyyyy Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694503 Share on other sites More sharing options...
premiso Posted November 20, 2008 Share Posted November 20, 2008 How are you calling the file, are you using the fullpath? After you use the chomd check the file permissions with fileperms I also seem to remember that the directory has to be writeable for this to work too...I am unsure if that is true or not. Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694508 Share on other sites More sharing options...
yolop Posted November 20, 2008 Author Share Posted November 20, 2008 yeh i am using the fullpath Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694514 Share on other sites More sharing options...
premiso Posted November 20, 2008 Share Posted November 20, 2008 I am not sure bud. The only other thing I can think of is you may have to give the file that is executing the chmod command the 0777 permissions via FTP for it to be able to assign the same permissions to another file. Other than that I am out of experience/ideas on and hopefully someone who really knows can help. Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694566 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.