Good day folks,
I was trying to update my wordpress site and i have this error:
Unpacking the update… Could not create directory. Installation Failed
After googling, i have found a solution that says:
Web Server Ownership
The first level is actually to make sure that your web server has ownership over the directories:
chown -R www-data:www-data your-wordpress-directory
Directory Permissions
The second level is also required – you must make sure that the directory permissions are properly set:
sudo find /var/www/wordpress/ -type d -exec chmod 755 {} \;
sudo find /var/www/wordpress/ -type f -exec chmod 644 {} \;
Could anyone guide me how to perform those tasks?
Regards
Related
Having a nightmare with permissions on RP3, apache2, php
I can run my php api script from terminal with no problems. I use the browser for debugging and get the 'permission denied' when trying to edit text files from the browser.
I have temporarily set permissions to 777 on /var/www but this is insecure, and i can no longer remember the original permissions that were on /var/www
Can i somehow give the broswer (chromium) permission to edit files in /var/www?
I have tried setting inheritance, but to no avail, as i am copying files over all the time, i have to keep resetting the permissions to 777 (which is not ideal), so i can debug the code in a browser.
Any help would be greatly appreciated
Rgds
Mike
Usually, the permissions for folders are 0755 and for folders are 0644.
To set the permissions for folders:
sudo find /var/www -type d -exec chmod 0755 {} \;
To set the permissions for files:
sudo find /var/www -type f -exec chmod 0644 {} \;
Now about the user/group, Apache is probably using the user www-data with group www-data.
To set the user/group for write permissions:
sudo chown www-data:www-data /var/www -R
A note about security: opening up the option to edit the files from the browser is insecure without any login, allowing anyone to edit your files. Also, the write permissions should only be allowed in a directory where the users upload files and NOT for all your /var/www files.
I use Docker for my project. After installing the 2.2.6 package with sample data, it gives me problems like the following when I execute php bin/magento cache:clean
The file "/var/www/html/src/generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php" cannot be deleted Warning!unlink(/var/www/html/src/generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php):
No such file or directory
The generated/code folder can not be deleted and I have to restart my computer then it does let me delete the folder
I use php 7.1.22 , percona 5.6.39 and docker Version 18.06.1-ce-win73 (19507)
This happens due to insufficient permissions on the project folder and files.Also www-data must be owner of the project if using Apache as web-server.
Please execute commands given below:--
sudo chown -R www-data:www-data [path to magento directory]
navigate to root of your magento project
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod u+x bin/magento
An important mania for people who offer their help is to think that all systems are the same.
www-data is the user as long as there are conditions, which many will not meet, because they prefer to use nginx + php-fpm instead of the generalist model.
Other times, included in that model is not the user running Appache, nginx or in the end, php, is www-data.
So the most correct answer is not:
Change the owner of the entire magento folder to www-data
Neither give permissions 777, this is the most common of all the aberrations in the network.
Lo mas correcto sería
Who executes the process you write in the magento directory?
PHP writes as user or globally?
I have consulted the configuration of my php (php, php-fpm, etc.) to verify which user is the one that executes the operations?
Once we have that data then if we can execute
sudo chown -R <user_correct>: <group_correct>
And please, stop paying attention to those who always write chmod -R 777
Or one day they will wake up without their site in a normal way but full of infections that are hardly curable.
Installing magento 2 from the command line of the container in Docker solves the problem of writing permissions in Windows for me
You may need to adjust the parameters:
bin/magento setup:install --base-url=http://local.shop.magento2.com \
--db-host=db_magento2 --db-name=magento --db-user=magento --db-password=magento \
--admin-firstname=magento --admin-lastname=magento --admin-email=user#example.com \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=USD --timezone=Europe/Madrid --use-rewrites=1
Just in case anyone stumbles upon this:
Add the following to your docker file
RUN echo "root:root" | chpasswd
This will allow you to switch to root and run chown
su root
password:root
chown -R user:group /folder
I've reinstall Ubuntu 16.04 and after getting pull my symfony 3.4 project from git, it loads but without CSS and JS. I think that the problem with the permissions for folders and files.
If it's permissions related, then first make sure of which user is your web user.
If you never changed it, then it's www-data
As for the permissions, do this (replace www-data if needed):
chown -R www-data:www-data /var/www/
find /var/www/ -type d -exec chmod 0775 "{}" \;
find /var/www/ -type f -exec chmod 0664 "{}" \;
find /var/www -type d -exec chmod g+s "{}" \;
[Warning]
In some projects like symfony, some files have the execution permission.
Doing this will remove the permission.
Thus, I recommand to move all your projects out of the /var/www folder before doing this.
When done with permissions, just copy (not move) your projects in the /var/www folder, they will inherit web user and web group (www-data in this case) and keep execution permission.
[Side note]
You're using too many tags.
file-permissions, symfony, ubuntu should have been enough... ;)
I am trying to install an extension on the store but when i visit the Magento Connect from admin panel its going to and Error page how to fix it.
I have tried by setting permission to download folder 755 and index.php t0 664 but still the error present.
FILE PERMISSION:
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;
sudo chmod o+w var app/etc
sudo chmod 550 mage
sudo chmod -R o+w media
And if i delete my htaccess file then Magento connect works fine but the store stopped working in this case
Please help me on this issue.
It's seems like your .htaccess file is blocking something. Replace that file from default installation of magento. If you want to know the issue please post your .htaccess code here.
I set up my free DevBox (Ubuntu, PHP) that I get from Codenaywhere and followed the installation instructions on the Laravel site.
I set up an htaccess in the root directory so it points to /public when I go to the domain.
I am getting a 500 error, but when I put in and index.html file in public it worked. Seems like it's not liking the index.php.
Why am I getting this error?
Got it working, had to set the proper permissions.
sudo find ./ -type d -exec chmod 755 {} \;
sudo find ./ -type f -exec chmod 644 {} \;
sudo chown -R www-data:www-data public
In that order, hope it helps.