I am facing a weird problem. I keep getting error messages on my drupal site by just visiting a node:
The specified file temporary://filezATB93 could not be copied, because
the destination directory is not properly configured. This may be
caused by a problem with file or directory permissions. More
information is available in the system log.
but all the dirs exist and have 777 permissions. I changed the temp dir from /tmp to tmp in the admin config but after visiting the website it switched back to /tmp again, so I put this in the settings.php:
$conf['file_temporary_path'] = 'tmp';
But both the /tmp and tmp have 777 permission. The weird thing is, when I export the database the table variable has the value pair temporary_file_path and it is always set to "/tmp", even if I drop the table and insert "tmp" right after that, every time the db exports "/tmp". How can I change this?
It can be a bit confusing, but the destination directory there refers to a path under Drupal's public file system, not the temp folder (which is the source in this case).
If you update permissions on the files folder, usually DRUPAL_ROOT/sites/all/default, the problem should disappear.
Related
I have been trying to change the permissions of new session files. According to this page, I need to change the mode in the session_save_path configuration in the php.ini file. I have changed it to 0777, the default is 0600. New session files are still being created with 0600 permissions. I have checked, the correct php.ini is loaded and the changes are saved. I have configured it like: 0;0777;/var/lib/php/sessions (N;MODE;/path). Can someone explain to me why the files are still created with 0600 permissions, while I have configured it to 0777?
The files are stored in /var/lib/php/sessions and I'm using Codeigniter.
The /var/lib/php/sessions/ directory typically has the "sticky" bit set on it -
drwx-wx-wt 2 root root 4096 Oct 15 11:21 /var/lib/php/sessions/
This is done via chmod 1733. Remember that using the setuid/setgid/sticky bits on a directory effect how files are created (default owner/group and permissions) in that directory and any sub-directory, regardless of system umask values, etc.
From this page - http://www.filepermissions.com/articles/sticky-bit-suid-and-sgid - which is part of a 3 article series on *nix file permissions which is pretty good.
A Sticky Bit, is a special setting within file permissions that helps
limit access beyond what normal file permissions are capable of. In
short, a Sticky Bit ensures only the owner of the file / directory is
able to delete or rename the file. However it should be noted that
root is able to edit and delete the file as well.
With the mode of 1733 the session data files can't be read by others on the system. This is a Good Thing.
Why do you want world readable session storage?
Edit -
If you really want to break it, create a new directory w/ appropriate permissions and change the session storage path to use that directory. Note that there may be an internal check in PHP that will make it refuse to store session data in a place it considers "insecure", much like SSH refusing to use keys w/ insecure permissions.
my server tmp folder (capacity of 4GB) gets full very fast (within a few hours). There are some small session files in there, but the ones which take up all the space are files named "php[UNIQUE_CODE]".
I already changed in php.ini both the "upload_tmp_dir" and "session.save_path" to another directory, but these "php*" files are still emerging. The session files are saved in the new directory.
I have owncloud and wordpress installed on the server since over a year, but this is something that occurs the last days.
How can I check which file or session is creating these large files on the tmp folder?
Thanks!
J
it is not related to session
these files are related to io
since i am using "fopen($filePath, 'rb')" in my code , these files are creating by system and will be delete automatically (if it has enough space on /tmp folder)
if you want to change /tmp for these type of file you can change below params in your .ini file and restart apache
upload_tmp_dir='/tmp2/'
sys_temp_dir='/tmp2/'
and be sure your folder has 777 + t permission , and user/group can be 'root'
I have problem with installing any extensions in Joomla! 3.4.4.
When I try to install any i have error
An error has occurred.
-1 Copy file failed
I set all CHMOD for 777 (for tests) in configuration.php there is correct path to tmp directory. One thing that is strange is info in joomla backend:
The PHP temporary folder is not set. The PHP temporary folder is the
folder that PHP uses to store an uploaded file before Joomla can
access this file. Whilst the folder not being set isn't always a
problem, if you are having issues with manifest files not being
detected or uploaded files not being detected, setting this in your
php.ini file might fix the issue.
I don't have access to php.ini so i can't use upload_tmp_dir . When i try make my own php.ini file and then make rule in .htaccess nothing happens. Maybe someone had the same problem?
Set the directory to 755 firstly. No need for 777.
Make sure the directory is linked via the home i.e.
/home/your_user_account/public_html/tmp
And also then check your hosting package has not run out of diskspace.
These are the common problems.
I'm using PHP to allow a user to upload a file. The file is being uploaded, but the permissions on the file are incorrect. I set up the permissions on the folder and checked the box that says apply to all children in the folder.
This works only after I make one change to the newly uploaded file. If I don't make a change to the permissions, it gets this default set that breaks the rest of my application.
For example, C:\uploads\ is set to allow users in the group "Everyone" to read and write. This however doesn't apply to the newly uploaded file until I do something to that specific file's permissions (add or remove any user or group to its permissions - this change gets overwritten by the folder's permissions).
This is on IIS6 (I believe) on Windows Server 2003
Windows upload file to temp directory and then move it with temp directory permissions. If You give good permissions to the user on this folder (upload_tmp_dir) then will be no problem.
You can also use windows system command:
CACLS or ICACLS
Do:
chmod()
On Your file after upload
I move drupal 7 from server(live Site) to my localhost(xampp). I change settings.php(files/defualt/settings.php) for database connection and remove cache from mysql database. now in load index, i see my website without css design(only text) and see this error :
**Error message**:
The file could not be created.
The file could not be created.
The file could not be created.
The file could not be created.
The file could not be created.
I think drupal not create css/js compression files. How To Fix This Error? Thanks For Any Help.
While running MAMP
found answer from here:
http://drupal.org/node/581558#comment-6202892
Went to: admin/config/media/file-system
changed "/tmp/php" to "tmp/php" and problem was solved.
similar to the other answer it was a problem with my file system setup. The tmp directory in my live site is in a folder outside the public_html folder.
so I just created a new tmp directory inside my directory structure
and
went to admin/config/media/file-system and
set the tmp folder to point to that new tmp folder.
It seems a permissions problems, after you cleared the drupal cache, all the css and js files needs to be recreated in sites/default/files (or sites/yourdomain/files), check the web users has permission to write in this directory.
You need to give your "Temporary directory" to write permission. From admin-> config -> file system
First Check whether the Temp Folder is available in your sites/default/files directory or not.
If Temp Folder is not available then create the Folder and give the correct access permission to that folder.
If Temp Folder already available there then check the permission of the folder.