ksduded Posted September 11, 2008 Share Posted September 11, 2008 I can't seem to use the mkdir() function without having 777 access to the folder the new folder is supposed to be placed. Is it some sort of settings that have to be changed by my Host to allow mkdir() fuction? my php file is stored in the www.hanna1.ca directory my code is PHP Code: <?php chmod('/home/highfid/public_html/www.hanna1.ca', 0777); mkdir('/home/highfid/public_html/www.hanna1.ca/joseph', 0777, true); ?> Additionally, I CHMODed the directory to 777 and for some reason, the index file in that directory dosen't opening up through the browser. I changed it back to 755 and it starts working again. what am i doing wrong? Link to comment https://forums.phpfreaks.com/topic/123804-solved-permissions-and-php/ Share on other sites More sharing options...
Caesar Posted September 11, 2008 Share Posted September 11, 2008 You can try using system function in PHP, after you create the directory in a temp folder with the correct permissions...though it's common shared hosting companies disable the system() function...I'll assume it's Linux based <?php system("mv /home/user/public_html/temp/folder /home/user/public_html/folder"); ?> Link to comment https://forums.phpfreaks.com/topic/123804-solved-permissions-and-php/#findComment-639226 Share on other sites More sharing options...
ksduded Posted September 11, 2008 Author Share Posted September 11, 2008 You can try using system function in PHP, after you create the directory in a temp folder with the correct permissions...though it's common shared hosting companies disable the system() function...I'll assume it's Linux based <?php system("mv /home/user/public_html/temp/folder /home/user/public_html/folder"); ?> apparently system() function works at my end... and your trick worked. Great. Many thanks Link to comment https://forums.phpfreaks.com/topic/123804-solved-permissions-and-php/#findComment-639252 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.