File permission errors Apache2
My FTP account (and major user account) is piagency. All my files and folders in my /var/www/ is set to piagency as owner and of the www-data group
the user account piagency is part of the www-data group
my php script first creates a directory (if it doesnt exist) then uploads the file to that folder.....or is supposed to.
[PHPNET=""]mkdir("/uploads/" . $_REQUEST['clientID'] . '/video/', 0777);
I get mkdir(): No such file or directory
failed to open stream: No such file or directory
Weird thing is that i cant delete the video folder and try again. Filezilla says folder is not empty
But it will create the folder
and it will upload the smaller file (there are actually 2 files that get uploaded to same folder)
but the folder says its owner is www-data and group www-data.
But from FTP i cant delete it.
August 31st, 2011, 09:52 AM
It should be "./uploads/" ... When you say "/uploads/" this indicates the uploads folder is in the root directory, but in reality it is in your user directory.
August 31st, 2011, 10:13 AM
No its in the root directory. The website displays links to these files for download.
Originally Posted by razordave
August 31st, 2011, 10:20 AM
I think we might have different definitions of root directory. On the web server, the root directory may be /uploads/. However On the filesystem of the server, The directory is probably something like /home/username/public_html/uploads/. My guess is that It is trying to write to /uploads/ on the main filesystem and that does not exist. Could you please verify?
August 31st, 2011, 12:53 PM
/uploads is in the root directory of my website not the home users root. I can't use ./ because this file calling this script is not in the same directory. But the problem is not with it creating the directory. If i delete the directory this script creates it.