Hobbyist_PHPer Posted May 9, 2011 Share Posted May 9, 2011 Hello everyone, so I made this script that creates directories via "a hack around" cPanel, on my own server, in order to create directories via my own software, but I also need to copy files from one directory into that newly created directory... Therein lies the problem... I created a script a few years ago that worked, but for the life of me I can't remember how I enabled myself to be able to use the copy function of php... Anybody know? Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/ Share on other sites More sharing options...
fugix Posted May 9, 2011 Share Posted May 9, 2011 so what happens when you go ahead an use the copy() funciton? Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212623 Share on other sites More sharing options...
Hobbyist_PHPer Posted May 9, 2011 Author Share Posted May 9, 2011 so what happens when you go ahead an use the copy() funciton? Warning: copy(/home/mydirectory/public_html/8_newdirectory/acontentpage.php) [function.copy]: failed to open stream: Permission denied in /home/mydirectory/public_html/account/CreateNewAccount.php on line 70 Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212624 Share on other sites More sharing options...
fugix Posted May 9, 2011 Share Posted May 9, 2011 okay so what you'll want to do before using copy is use chmod() on the file to allow you permissions Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212629 Share on other sites More sharing options...
Hobbyist_PHPer Posted May 9, 2011 Author Share Posted May 9, 2011 okay so what you'll want to do before using copy is use chmod() on the file to allow you permissions I'm pretty sure it's a cPanel set permission thing, just have to go into the server and change it somehow, I just can't remember how... Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212631 Share on other sites More sharing options...
fugix Posted May 9, 2011 Share Posted May 9, 2011 il check my cPanel for it Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212634 Share on other sites More sharing options...
Hobbyist_PHPer Posted May 9, 2011 Author Share Posted May 9, 2011 il check my cPanel for it It won't be in any cPanel settings... you have to SSH into the server and change the permissions manually... I probably need to find a Linux/cPanel forum and ask... Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212635 Share on other sites More sharing options...
fugix Posted May 9, 2011 Share Posted May 9, 2011 maybe, found this tough. Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212636 Share on other sites More sharing options...
Hobbyist_PHPer Posted May 9, 2011 Author Share Posted May 9, 2011 maybe, found [urlhttp://www.siteground.com/tutorials/cpanel/file_permissions.htm]this[/url] tough. Yeah, thanks, but if only it were that easy... You see it won't let me make permission changes like that, and if I logged in as root and made those changes, then they could only be modified by root, and I certainly don't want to put my root information into a php script... Quote Link to comment https://forums.phpfreaks.com/topic/235891-php-copy/#findComment-1212637 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.