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. 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? 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 Quote 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. Link to comment https://forums.phpfreaks.com/topic/245705-create-folders-mkdir/#findComment-1262019 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.