Jump to content

mkdir() function not working


sridaran
 Share

Recommended Posts

I need to create a new directory and also subdirectories inside that directory in the specific location. I am using the following code, where $msg is displaying perfectly on both if & else condition and $workgrp is the name we are giving in input text box. But no directory created on the specified location. I am using PHP 5.1.6 version in Redhat Linux 5 version. Do I need to make any changes on the php conf file to make mkdir() function to work? $imt_dbpath = "/home/workarea/mailer/development/imtdbpath/"; if(file_exists($imt_dbpath.$workgrp)){ $msg = "Work Group Already Exists"; }else{ umask(0); mkdir($imt_dbpath.$workgrp,0777); $file = fopen($imt_dbpath.$workgrp."/users",'w+'); fclose($file); mkdir($imt_dbpath.$workgrp."/campaigns",0777); mkdir($imt_dbpath.$workgrp."/ftpbox",0777); mkdir($imt_dbpath.$workgrp."/uploadbox",0777); $msg = "Work Group Created Successfully"; }R.Sridaran

Link to comment
Share on other sites

Do you get any errors? Does PHP have permissions to modify the directory parent to the folders you want to create?

Link to comment
Share on other sites

I am not getting any errors. If I give new name, it is displaying message "workgroup created successfully". But no folders(workgroup) on the specified location. If I give the existing name, it is displaying message "workgroup already exists".Path Folder PermissionFolder Access : Create and Delete FIlesActually this directory should be created on the Sqlite database path "/home/workarea/mailer/development/imtdbpath/"(PHP & Sqlite are Connected). Also if we create any directory in the db path manually, it is displaying in the front-end php as dropdown list.R.Sridaran

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...