Hi, Using php I'm trying to dynamically create a folder and files within the folder. If I use mkdir($titlefolder, 0777); It doesn't create the folders as I expect. They have rwx r-x r-x access But I need to have at least rwx r-x rwx access as I did before to create the files. Because the user is set to apache I can't change the access manually. What can I do to get the access I need? Is there some way to sign in to my domain so it will allow me to do what I want? Thanks, Travis
hi, I guess, php could be run in safe mode. once I faced this problem and coded a small script to connect via ftp (in code) and change file/folder permissions.
I had a look at chown but it appears to only work for files not directories. I may be wrong. The ftp method sounds interesting. Any ideas on how the code would look? Thanks, Travis
<?php $ftp_server = 'ftp.yoursite.com'; $ftp_user_name = 'username'; $ftp_user_pass = 'password'; $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name<br>"; } // the home directory / the folder you change permissions $dir = 'httpdocs/permissionforthisfolder'; // try to create the directory $dir if (ftp_mkdir($conn_id, $dir)) { echo "successfully created $dir<br>"; } else { echo "There was a problem while creating $dir<br>"; } if (ftp_chmod($conn_id, 0777, $dir) !== false) { echo "$dir chmoded successfully to 777<br>"; } else { echo "could not chmod $dir<br>"; } ?> PHP: regards..