Forum Moderators: coopster
I have a problem since a long time with a script that creates directories, when executes the following code create it with the owner and group as 'nobody' but don't allow me to work inside the folder.
if (!@file_exists($thumbs_path) ¦¦!@is_dir($thumbs_path))
{
$old_umask = umask(0);
@mkdir($thumbs_path, 0777);
umask($old_umask);
//@chmod($thumbs_path, 0777);
}
Should I uncomment and move the chmod line before umask?
Is there a way to set the owner to my user when creates it, not to 'nobody' without using chown and chgrp?
Thank you!
Setup an FTP user to access to a specific path and after use the PHP script to login by FTP and create a folder and give 0777 permissions. So, this folder will have my user as owner or 'nobody'?
I don't want to try again this method before know what might be happen because I must contact my host to set the folder to my user to be able to work inside it.
<?php$conn = ftp_connect($host);
ftp_login($conn, $ftp_user, $ftp_pass);@ftp_chdir($conn, './data/');
@ftp_mkdir($conn, 'test1');
@ftp_chmod($conn, 0777, 'test1');
ftp_close($conn);?>
Who will be the owner/group of the directory? FTP_user, main user account or 'nobody'?