I've read through the official docs of drupal 8 and still don't get the idea of how to setup correct permission of the folders and files.
When we give 777 permission it might work but it's not an elegant way to do so, is there any easy way to setup permission. I'm using Ubuntu 16.04.
If your system is running with an enforced security policy (SELinux) you may have to set the appropriate rules for httpd/drupal to run properly.
Other than that, following requirements as specified in INSTALL.TXT should be enough.
Missing files directory :
mkdir sites/default/files
chmod a+w sites/default/files
You can also set permissions on sites/default/ as well so that your web server is able to create directories under this path :
chmod a+w sites/default
Missing settings.php :
cp sites/default/default.settings.php sites/default/settings.php
Make it writable for the installation :
chmod a+w sites/default/settings.php
And once the installation is finished, set the permissions back :
chmod go-w sites/default/settings.php
Multisite :
For a multisite installation you would replace default by the site directory :
mkdir sites/example.com/files
chmod a+w sites/example.com/files
cp sites/default/defaults.settings.php sites/example.com/settings.php
Related
I have a Laravel project (version 5.3) that works well on my localhost (wampserver).
Now I want to run this project on a subdomain of my website.I have ssh root access and a vps user access (not admin - with Directadmin - PHP version 5.4).
I uploaded project files to my server but when I try to see the project result , it gives me a 500 error.
I have tried to change 'storage' folder permissions , so I read this answer , but when I run "chchon" ssh command , I get errors like this :
can't apply partial context to unlabeled file ...
also , I have tested Laravel with version 4.2 and it worked well.
Does any boy have idea ?? Thanks
If you don't have SELinux enabled, you can set permissions simply with chmod or set the owner of the storage directory with chown to the web server's user. (which is probably www-data)
Try to run sudo chown -R www-data storage in the project directory
Try all this
// first delete the vendor folder inside your project root, then run
composer install
// laravel generates log file there
sudo chmod -R 777 storage/logs
// laravel cache the files here
sudo chmod -R 777 bootstrap/cache
// vendor folder, where laravel saves their dependencies
sudo chmod -R 777 storage/ vendor/
// generate a application key
php artisan key:generate
This might help :)
I am trying to set up symfony. I am running ubuntu, I have apache2, phpmyadmin and phpstorm installed. I am getting this error under config.php of my project:
MAJOR PROBLEMS Major problems have been detected and must be fixed
before continuing: Change the permissions of either "app/cache/" or
"var/cache/" directory so that the web server can write into it.
Change the permissions of either "app/logs/" or "var/logs/" directory
so that the web server can write into it.
so I went to /var
I tried a few things:
sudo thunar and then changed all the permissions to writeable. This didn't work and the permissions changed right after.
I went on this site, it says to use certain commands to fix permissions: sudo chmod 754 /var/cache and sudo chmod 754 /var/log and sudo chmod -R 775 /var/cache and sudo chmod -R 775 /var/log
This also did not work
I should also note that I have cleared my cache and restarted apache2.
Glad you figure it out by your self.
In any case you can read more about it here: Setting up Permissions / Symfony2
Let me know. Ciao!
I figured it out. The cache and log are within the app themselves. This did not make much sense to me initially considering that the permissions of the folder they are in (the root, the www folder) had already had all their permissions set appropriately. All I did was set chmod -R 755 on those folders IN my app.
I have this Laravel project on my Ubuntu machine, and i accidentally gave chmod -R 777 to Ubuntu root. I did manage to cancel it, but it was to late. Now, like half of my root is green.
I have nothing useful on this machine except that Laravel project, and I have no problem with re-installing it. Is there a way to rebuild it? If not, when i backup my project, how to give it normal permission?
I've been through this before
Just run
sudo chmod 0644 -R * in your application's root directory
it will set the default permission level to -rw-r--r-- (0644). As new laravel application comes with this permission level.
and you need to give write permission to storage folder and its files so run
sudo chmod 0755 storage and sudo chmod 0755 storage/* -R
You are good to go now. and for more about file and its permission level, I would recommend you to go through this https://askubuntu.com/questions/638796/what-is-meaning-of-755-permissions-in-samba-share it will help.
When you reinstall the project it will gain the regular permissions. Remember that you only have to give 777 permissions to the "storage" folder.
And as far as I know, there is no way to set your Ubuntu files as they were before.
Just change and update permissions of public/ folder inside your Laravel app/ folder to 0775, and then change permissions of files inside public_html/ folder to 0644. Also what is worth of noticing is user:group. What server and how do you run PHP handler?
Hi anyone can help me for this issue , I have developed a site and it is hosted on my development server but now my client wants to move it to his own production server, and my client doesn't have access to his cpanel for this server. I only have the ftp access, so I have added his database in my own development server, while in development I used my amazon s3 for storing the images , when I push to production I loss the amazon plugin . I can't able to install the plugin , so I moved to upload once again to those images through WordPress, now I face this error while uploading an image : Unable to create directory wp-content/uploads/2014/07. Is its parent directory writable by the server? , and change the ftp file permission access to 755 and changed the uploads file permission to 777 , Still I am not able to upload the images, can some one help me for this issue.
This is a problem of the Apache permissions. I had this problem and i broke my mind for many days to understand what was happening.
The correct way (USE IT):
(the solution that i used, and worked)
You need to give Rewrite permissions to the Apache.
For Ubuntu:
Run via ssh: chown -R www-data:www-data /var/www/the/wordpress/directory
For Centos:
Run via ssh: chown -R apache.apache /var/www/the/wordpress/directory
The Wrong Way (I don't recommend it, but works...)
You can change the permissions to 777 in all the paths that Wordpress need to change. wp-content/plugins recursively on folders to solve install/update problems, and wp-content/uploads recursively on folders to solve upload media problems.
Never use it because you are giving permissions to anyone change your files. A open way for the crackers that don't like you.
run these command to provide proper file permissions
Add existing 'ubuntu' user to 'www-data' group
sudo usermod -a -G www-data ubuntu;
Set the ownership of the files/directories
sudo chown -R www-data:www-data /var/www/html/;
Set group ownership inheritance
sudo chmod g+s /var/www/html/;
Set the permissions of the files/directories
sudo find /var/www/html/ -type d -exec chmod 755 {} ;
sudo find /var/www/html/ -type f -exec chmod 644 {} ;
Give write permissions to the group (for editing files via FTP)
sudo chmod -R g+w /var/www/html/;
I'm creating a site which I'm going to host on an Ubuntu Server. I have a user registration form on my site, which creates a user and a folder for that user (if filled out correctly). The form in handled by PHP and I'm running Apache 2 on the server. When I run the code on my laptop the folder is created, but when I run the same code on the server the folder is not there. I guess that it has something to do with permisssion. How can I tell apache that the code should have write permission in a specific folder called "users" located in /var/www/mysite/public/users/ ???
Try using chmod command that provides folder permission. Something like
chmod 777 -R foldername
If security is not an issue I would suggest:
chmod 775 -R /var/www/
chown -R [your_user]:www-data /var/www/
So both apache2 (www-data) and you can edit folders and files inside /var/www (or /var/www/html if this is your folder).
Notice that this may have issues with git and other tools that capture folder permissions (eg with git you may commit files with 775).