I am facing an error when trying to run a project developed in Moodle. It's showing "Invalid permissions detected" when trying to create a directory. "Turn debugging on for further details." This error. I have run this command, "chmod 0777 /var/www/html/e-learning" to enable write permission, but still doesn't work. Can any one suggest? Thank you.
It's probably the data directory not the web directory
https://docs.moodle.org/401/en/Installing_Moodle#Create_the_.28moodledata.29_data_directory
Look for this value in config.php
$CFG->dataroot = '/var/yourmoodledatadirectory';
Then change permissions
sudo chmod -R 0777 /var/yourmoodledatadirectory
Also add this to config.php
$CFG->directorypermissions = 02777;
You might also need to change the ownership of the data directory
sudo chown -R www-data /var/yourmoodledatadirectory
Also, 777 for the web directory isn't recommended, use 755 instead
sudo chmod -R 0755 /var/www/html/moodle
I'm using in my Wordpress host the follow permissions:
775 for folders
644 for files
although these is the recomended configurations, i can't update wordress, plugins and upload images to media.
I've got any others sites these permissions works normally.
chown -R www-data:www-data *
will solve your issues (considering that your Apache / nginx or related webserver user is www-data).
Some time before I faced the same issue with my Wordpress sites.
Solution is here:
sudo chown www-data:www-data /var/www/html/ -R
and to make this solution more secure use
sudo chmod -R 774 /var/www/html
It will fixed the issue
I installed ubuntu server 14.04 then (apache,php and mysql).
I uploaded my website to /var/www/html and nuzip it and linked it to database.
When I request my ip in the browser i get the home page, but when click on any url in the site it returns 404 not found error - not from my website- but from the server.
I searched but problem not solved
this is what i tryed
chmod -R g+w /var/www/html
chown -R $user:$user /var/www/html/
chown -R www-data:www-data /var/www/html/
but non of this works.
any idea ?
If you are using Laravel, please keep in mind that you have to separate "public" folder and the app itself.
First of all, go to /var/www and create folder called "app".
Put everything in here excluding public folder.
Contents of public folder goes to /var/www/html.
Now, edit routes in /var/www/html/index.php
From __DIR__.'/../bootstrap/app.php to ../app/bootstrap/app.php
Do the same with other routes in here.
Don't forget to change the permissions. The easiest way would be to set it to 777 for the whole /var/www using sudo chmod -R 777 /var/www
Good luck.
I solved the problem by running this command
a2enmod rewrite
then restart apache server.
Thanks to everybody tryed to help me :)
I'm using WordPress on centos 6.
I try to install a plugin. But I got this error:
Installing Plugin: bbPress 2.5.9
Downloading install package from https://downloads.wordpress.org/plugin/bbpress.2.5.9.zip…
Unpacking the package…
Could not create directory.
How can I resolve this?
P/S: I run this command:
sudo -u root touch /var/www/html/wordpress/wp-content/plugins/test.txt
and it works. But I still get that error.
You only need to change the access permissions for your WordPress Directory:
chown -R www-data:www-data your-wordpress-directory
You can fix this by using the following commands. You should first be in the root folder of Wordpress.
sudo chown -R www-data:www-data wp-content/plugins/
sudo chmod 775 wp-content
sudo chown -R www-data:www-data wp-content/
The user that is running your web server does not have permissions to write to the directory that Wordpress is intending to create the plugin directory in. You should chown the directory in question to the user that is running Wordpress. It is most likely not root.
In short, this is a permissions issue. Your touch command is working because you're using it as root, and root has global permissions to write wherever it wants.
A quick solution would be to change the permissions of the following:
/var/www/html/wordpress/wp-content
/var/www/html/wordpress/wp-content/plugins
Change it to 775.
After installation, don't forget to change it back to the default permissions.. :D
I had to give ownership of /plugins and /upgrade to the server, nothing else.
$ cd /var/www/wordpress/wp-content
$ sudo chown www-data:www-data /plugings
$ sudo chown www-data:www-data /upgrade
Running Apache server on Ubuntu 18.04. Maybe more dirs will need to be changed later. Anyways, I plan to restore permissions once I finish editing, as suggested in this anwser.
If you have installed wordpress using apt, the config files are split in multiple directories. In that case you need to run:
sudo chown -R -h www-data:www-data /var/lib/wordpress/wp-content/
sudo chown -R -h www-data:www-data /usr/share/wordpress/wp-content/
The -h switch changes the permissions for symlinks as well, otherwise they are not removable by user www-data
To solve permission issue on plugins and themes on localhost or production quickly, you just run this
sudo chmod 757 wp-content/themes
sudo chmod 757 wp-content/plugins
if take care permission on production, you can run
sudo chown -R www-data:www-data wp-content/themes
sudo chown -R www-data:www-data wp-content/plugins
If you are mac user , using XAMP
Go to the htdocs folder and open the terminal on the folder , as shown in the screenshot
Then Type the following command on the Terminal
**sudo chmod -R 777 <your wordpress folder Name>/**
E.g sudo chmod -R 777 wordpress/
CentOS7 or Ubuntu 16
1.
WordPress uses ftp to install themes and plugins.
So the ftpd should have been configured to create-directory
vim /etc/pure-ftpd.confg
and if it is no then should be yes
# Are anonymous users allowed to create new directories?
AnonymousCanCreateDirs yes
lastly
sudo systemctl restart pure-ftpd
2.
Maybe there is an ownership issue with the parent directories.
Find the Web Server user name and group name if it is Apache Web Server
apachectl -S
it will print
...
...
User: name="apache" id=997
Group: name="apache" id=1000
on Ubuntu it is
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
then
sudo chown -R apache:apache directory-name
3.
Sometimes it is because of directories permissions.
So try
sudo chmod -R 755 directory-name
in some cases 755 does not work. (It should & I do not no why) so try
sudo chmod -R 777 directory-name
4.
Maybe it is because of php safe mode.
So turn it off in the root of your domain
vim php.ini
then add
safe_mode = Off
NOTE:
For not entering FTP username and password each time installing a theme we can configure WordPress to use it directly by adding
define('FS_METHOD','direct');
to the wp-config.php file.
If anyone using shared hosting and get same problem it may be disk space issue. In that case contact with your hosting support and ask them to increase disk space of your acocunt.
You need to change the permission of the directory
At first change the user HTML folder (replace yourcomputerusername)
sudo chown yourcomputerusername:yourcomputerusername /var/www/html
Next change the permission for the user
cd /var/www/html
sudo chmod -R goa=rwx wordpress
or
sudo chmod -R 777 wordpress/wp-content
I was on XAMPP for linux localhost and this worked for me:
sudo chown -R my-linux-username wp-content
What I end up doing is every time I create a WordPress project. in /www/html
I run below command
sudo chown www-data:www-data wordpress_folder_name -R
hope this will help someone.
For me the problem was FTP server that WP is using to upload update. It had writting disabled in configuration, so just enabling it fixed the problem.
Shame on WordPress for providing such misleading error message.
You could try
sudo chmod goa=rwx -R /var/www/html
None of the above work for me except this one.
sudo chown daemon:daemon /opt/bitnami/apache/htdocs/
Don't forget to change /opt/bitnami/apache/htdocs/ to your directory
Webserver user must have write access to directories to perform such operations, so you can try to change owner of files to webserver user (apache in this example, but can be differ from yours)
chown -R apache YOUR_BLOG_DIRECTORY
If you are using some app that wraps http, you have to set these user in the command.
sudo chown -R [desireduser]:[desireduser] wp-content/
By example, if you are using lampp, the users that init httpd is "daemon" and the command that works will be:
sudo chown -R [desireduser]:[desireduser] wp-content/
You can search in your httpd.conf file
To solve permission issue on ubuntu server, you just run this
sudo chmod 777 -R 'wordpress wp-content file location'
for example.
sudo chmod 777 -R /usr/share/wordpress/wp-content
wordpressProject is the project name.
/var/www/html/wordpressProject sudo chmod -R 777 wp-content
Thanks. It will work.
Absolutely it must be work!
Use this
chown -Rf www-data:www-data /var/www/html
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/;