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 Quote 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. Quote 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??? Quote 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 Quote 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. Quote 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 Quote 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 Quote 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. Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/133524-problem-with-copy/#findComment-694566 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.