Announcement

#1 2021-07-05 14:18:27

J0nny
Member
2017-12-15
32

File permissions error on update

Hi

I am trying to update one of my 3 piwigo installations and I am getting a file permissions error.

Currently folders are set to 755, ie only the owner can write but everyone can read or execute

Files are set to 644, everyone can read but only the owner can write , or some are set to 775 so everyone can execute as well.


Whats confusing me is my other two piwigo installations on the same server have updated with no problems.

When I have uncounted similar problems in the past, after a few hours reading I have given up, set everything to 777, done the upgrade then back to 775 after,however I would prefer a more secure way if possible.

What should file permissions be and any advice much appreciated. Simple explanations if possible. I know how to set file permissions in my ftp program but otherwise I know nothing about permissions and users.


Regards,

Jonathan

Piwigo 11.4.0 Check for upgrade
Operating system: Linux
PHP: 7.4.19 (Show info) [2021-07-05 10:56:34]
MySQL: 5.6.49-log [2021-07-05 06:56:34]
Graphics Library: ImageMagick 7.0.9-8

https://sheffieldfromabove.co.uk/sheffi … ory/aerial

Last edited by J0nny (2021-07-05 16:13:08)

Offline

 

#2 2021-07-05 16:03:03

Zentalquabula
Member
2014-05-10
217

Re: File permissions error on update

sudo chown -R www-data:www-data .

Offline

 

#3 2021-07-05 17:09:37

J0nny
Member
2017-12-15
32

Re: File permissions error on update

Many thanks.

I understand that is a Linux Command and it will reset file owner as the default owner.

Unfortunately  I don't know how to run a linux command.

How do I run it?

I have ftp access to my webserver via  filezilla, plus I have access to my hosts console.  I have googled it, there are millions of websites offering to help but they all go on and on about what is in the linux command, not how and where you execute it.

Offline

 

#4 2021-07-05 18:40:58

J0nny
Member
2017-12-15
32

Re: File permissions error on update

The problem is fixed.

I spoke to my hosting provider. They explained that to run chwon one needs an "SSH Client". Unfortunately this command would require "root access"  and I don't have root access.  The good news is they ran the chown command for me and now the update has completed without a problem.

Offline

 

#5 2021-07-05 20:38:14

erAck
Only trying to help
2015-09-06
2026

Re: File permissions error on update

In short: there is no "one answer fits all".

Specifically some sudo command is ill-advised if the setup constellation isn't known and neither is the user's expertise.

Regarding directory and file permissions, it really depends on which user owns the files and as which user the web server runs. In hosting packages that usually is the same web server user and group as it was the one creating files when installing the software; things can be more complicated if a dedicated ftp user owns the files. During an upgrade (performed by the web server) the then writing user obviously must have write permissions.

Iff your web server (e.g. user www-data) owns the files and also the files' primary group is the web server's group (i.e. the above example's ownership is www-data:www-data) and you (as a different user) never edit files from the command line (or by other means not involving the web server user) then directory permissions 750 and file permissions 640 are perfectly fine.

If you edit files from the command line and belong to the primary group but are not the owner of the files then 770 and 660 may be needed.

There can be other constellations, for example where you and the web server are the same primary user (i.e. in a chroot jail), in which case even 700 and 600 may be sufficient.

If xx7 and xx6 are needed that's a sign for a questionable setup.

But things may be setup differently using ACLs that go beyond primary user,group,others permissions. If in doubt and unless you manage your own server always ask your hosting provider.


Running Piwigo at https://erack.net/gallery/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact