dhope Posted August 25, 2011 Share Posted August 25, 2011 Hi, How do you create a folder in the main dir (public_html) when you are a few folders deep? My code... mkdir("../../../../../filestore/images/$page_id/", 0644); I seem to get an error each time failing to create the folder. Is there away to go direct to the public html folder? Thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/245705-create-folders-mkdir/ Share on other sites More sharing options...
cunoodle2 Posted August 25, 2011 Share Posted August 25, 2011 Can you try the absolute path.. I.E. Mkdir("home/dhope/public_html/NAME/"); ?? Is it possible that it is a permissions issue? Quote Link to comment https://forums.phpfreaks.com/topic/245705-create-folders-mkdir/#findComment-1261998 Share on other sites More sharing options...
requinix Posted August 25, 2011 Share Posted August 25, 2011 Is there away to go direct to the public html folder? Yes: $_SERVER["DOCUMENT_ROOT"]. mkdir($_SERVER["DOCUMENT_ROOT"] . "/filestore/images/$page_id", 0755); Note the 0755: directories need to be executable. Quote Link to comment https://forums.phpfreaks.com/topic/245705-create-folders-mkdir/#findComment-1262019 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.