0

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?

2
  • 1
    You should always use nobody user to edit or run magento command, never use root or any other user
    – blue
    Commented 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 failure
    – Marbonka
    Commented Mar 21, 2020 at 13:43

1 Answer 1

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
2
  • 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 terminal
    – Marbonka
    Commented 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 @MagenX
    – Marbonka
    Commented Mar 22, 2020 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.