Destination directory is not properly configured for Drupal - drupal

I keep getting the error on my Drupal 7 site - even after I have configured the logging and errrors to 'none'
I have made my tmp file writeable 777 and checked the file directory is correct under 'file system' I have made my sites/default/files directory writeable also
Cannot seem to get rid of this error - it reads:
The specified file temporary://fileg2e71m 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.
Any suggestions?

Have resolved the issue:
It was an ownership issue where the files are owned by the Apache user. I Set PHP 5 to run in cgi-mode on my cPanel.

Drupal 7 and drupal 8 and 9:
After importing a Database, some paths are not quite well defined. Go to /admin/config/media/file-system and hit "Save Configuration". Now the Translations-import works fine.

Related

How to solve this error in moodle ? and setup in localhost?

Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.
You need to check 'config.php' in your moodle installation files directory.
There you can find a line like below, which shows your directory name (it seems empty as per your error, you need to define path here) - in this directory/folder your moodle media uploads get store.
$CFG->dataroot = '/var/moodledata';
Moreover, after define this you will require to give Read,Write,Execute permissions to this folder.
(here '/var...' mentioned as Ubuntu directory structure, in localhost you need to mention respectively)

Drupal 8.2.6 /tmp

Drupal 8.2.6
Media Entity 8.x-1.0-alpha4
Ctools 8.x-3.0-alpha27
So after turn on CSS/JS aggregation I noticed that I can not upload images anymore. When I try to upload an image it gave me an error. So I changed my tmp directory to
sites/default/files/tmp
but that didn't help and gave me an error of
The file could not be saved. An unknown error has occurred.
File upload error. Could not move uploaded file.
This value should not be null.
I checked the permissions. default folder is 755. files folder is 755. tmp folder is 755. This also started affecting my Drupal 7 website after I enabled aggregation, so I am certain this is what is affecting my site.
Any information or leads would be very helpful, as I've been stuck.
After a long 2 days struggling to find the answer, I finally found a temporary solution. I used the command chmod -R 1777 /tmp . Then in admin/config/media/file-system I set directory to /tmp . Might have security vulnerabilities, but it works for me.

Move symfony vendor outside the root project

I want to speed up my symfony2 project on my vagrant box, so I want to move my vendors outside the project folder.
I have install them in /home/vagrant/www/simtp/vendor, but I got a permission error when the autoload.php is included.
Warning: require(/home/vagrant/www/simtp/vendor/autoload.php): failed to open stream: Permission denied in /var/www/simtp/app/autoload.php on line 11
Fatal error: require(): Failed opening required '/home/vagrant/www/simtp/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/simtp/app/autoload.php on line 11
I have already tested to change permission with chown, before it was "root", and now it is "www-data" (like the old vendor folder). I have already too tested to change chmod for 777.
But nothing work ... :/
Ps : My cache folder is empty.
What can I do?
Thanks.
I am no expert in this, but since no one else replied, I think easiest solution would be moving vendor files to directory that is not in other user's home directory. in this case:
/home/vagrant/
to let's say:
/var/www-vendor/simtp/app/
this vendor directory should have chown compatible with apache worker (so it would have access)
you can also try solutions described here:
https://unix.stackexchange.com/questions/91488/allow-a-user-to-read-some-other-users-home-directories
as far as I know despite standard permissions, user home directories are especially protected, that is the reason you have this issue.
you also didnt stated what linux distro you are using so you could consider adding this to your question so others would have less work to do.

Permission denied error in wordpress 3.3.1

I once moved my wordpress directory one level up on my server (its now in the root). Everything seems to work fine for a while but niow i'am starting to have troubles with uploading images.
When i try to include an image by uploading it from my computer wordpress throws an "Permission denied" error:
copy(/home/bram/domains/dutchmountaineer.com/public_html/wp-content/uploads/2012/05/Costa-Rican-Frog.jpg)
[function.copy]: failed to open stream: Permission denied in
/home/bram/domains/dutchmountaineer.com/public_html/wp-admin/includes/file.php on line 348
618
I tried setting the uploads and includes folder to 777 which had no effect. I have set them back to 755.
Any help please!
Jorrit
EDIT:
I tried changing the full path (in media settings) but it was of now help. I think it since i moved the wp installation from /wp/ to the root of my server
Check who owns the directory. It may be possible that you need to add www-data to the group. Weird, yes, but I sometimes encounter scenarios where even files and directories with 777 are denying me access if I don't add my user to the owner group.
It means you are getting error near this code
// Copy the temporary file into its destination
$new_file = $uploads['path'] . "/$filename";
copy( $tmp_file, $new_file );
unlink($tmp_file);
check your settings under settings->Media tab in admin panel and check you have the appropriate permissions for the folder, you can change the upload path as well. Let me know if problem still persists.
You have to allow uploads directory 777 rights and check your folder user and ftp user are same or not.

WordPress update failing

I'm having a problem when trying to update WordPress to the latest version I get the following error:
Download failed.: Destination directory for file streaming does not exist or is not writable.
Installation Failed
I'm also having the same problem when uploading images, it fails and gives the following error
has failed to upload due to an error
The uploaded file could not be moved to "the website path and then uploads directory"
I have checked the permissions of the folders and the folders themselves are set to 755 & the files inside them set to 644.
Could anyone tell me why it would be doing this?
Where running a plesk server.
Thank You,
Mark
Are there any more error messages, probably also in the servers log files? Probably the download for the update should be done to /tmp and you are not allowed to store files there? Try setting the constant WP_TEMP_DIR which should change the directory. Put something like this in your wp_config.php:
define('WP_TEMP_DIR', ABSPATH . 'wp-content/');
The permissions you're using seem reasonable, but they will only work if the FTP user that WordPress is using (set in your wp_config.php file) is the same as the owner of those files/folders.

Resources