jargen Posted February 2, 2010 Share Posted February 2, 2010 Hi, I have got a ftp script. which backs up all the folders into a directory. That works fine but when i try to set the directory to behind the web root it dosent work. I need it to back it up into /whatever the file is in /var/www so i tried this "../../whatever" but it didnt work. if i set it to "whatever" it works fine (but the folder is in /var/www (/var/www/whatever)) when i need it in /whatever. Any help. Thanks Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/ Share on other sites More sharing options...
PHP Monkeh Posted February 2, 2010 Share Posted February 2, 2010 Have you just tried setting it to: '/whatever' ? That should (if you're allowed) access the 'whatever' directory from the filesystem root. Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/#findComment-1005706 Share on other sites More sharing options...
jargen Posted February 2, 2010 Author Share Posted February 2, 2010 it just makes the folder in the directory the file is in. Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/#findComment-1005711 Share on other sites More sharing options...
akitchin Posted February 2, 2010 Share Posted February 2, 2010 have you created the "/whatever" folder where it should be, and properly set permissions for it? if so, i would guess that it has something to do with the user that the FTP script is operating as not having appropriate permissions to access directories above the web root. Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/#findComment-1005714 Share on other sites More sharing options...
jargen Posted February 2, 2010 Author Share Posted February 2, 2010 I dont need to create the /whatever folder the script does that automaticly. I just cant make it do it in the correct place Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/#findComment-1005717 Share on other sites More sharing options...
akitchin Posted February 2, 2010 Share Posted February 2, 2010 my point was that perhaps the script doesn't have the appropriate permissions to create the folder at that level. it might be worth creating that directory with the appropriate permissions manually and trying the script again. Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/#findComment-1005718 Share on other sites More sharing options...
jargen Posted February 2, 2010 Author Share Posted February 2, 2010 what permissions would it need? ive made it have 777 Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/#findComment-1005719 Share on other sites More sharing options...
jargen Posted February 2, 2010 Author Share Posted February 2, 2010 Aha sorted it. Needed to change the permissions on the root dir Link to comment https://forums.phpfreaks.com/topic/190706-going-behind-web-root-directory/#findComment-1005720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.