I'm using CentOS 8 as my OS on my laptop and currently running OpenLiteServer (lsphp73) and have been successfully installed phpmyadmin and magento 2.3.4. Then, it comes with a problem that everytime I want to run something related to cache it always said:
Permission denied / Operation not permitted because /var/cache owned by nobody:nobody always has 775 file permission.
I have to chown first with my username and do some bin/magento command then change it back to nobody:nobody to make it run on localhost subfolder and show in the browser.
It's not a big problem but quite irritated by this. I'm quite new with CentOS 8 anyway and trying to learn a bit deeper in Magento. Has anyone facing the same issue?
-
1You should always use nobody user to edit or run magento command, never use root or any other userblue– blue2020年03月21日 04:31:34 +00:00Commented Mar 21, 2020 at 4:31
-
that's precisely what I'm going to do and trying to find the command, tried this one "su - nobody -s /bin/bash" but I always get authentication failureMarbonka– Marbonka2020年03月21日 13:43:54 +00:00Commented Mar 21, 2020 at 13:43
1 Answer 1
this is not about operating system, this is only permissions.
if your webserver/php user is nobody, then you better run all commands as nobody.
https://linux.die.net/man/8/sudo
su -c "Your command right here" -s /bin/bash nobody
sudo su -c "Your command right here" -s /bin/bash nobody
su nobody -s /bin/bash -c "Your command right here" -s /bin/bash
sudo su nobody -s /bin/bash -c "Your command right here"
or you go into nobody environment:
su - nobody -s /bin/bash
-
I'm trying to do this su - nobody -s /bin/bash as it is more persistent solution in dev time, but it always got authentication failur on my terminalMarbonka– Marbonka2020年03月21日 13:42:00 +00:00Commented Mar 21, 2020 at 13:42
-
Got, it, so i have to login into the root first, then do the command, sudo is not working. Thank you @MagenXMarbonka– Marbonka2020年03月22日 07:59:40 +00:00Commented Mar 22, 2020 at 7:59
Explore related questions
See similar questions with these tags.