PHP-FPM permission issue?
by BrokenLamp from LinuxQuestions.org on (#6MQ9C)
Hello.
I have installed PHP-FPM in my system, but I am unable to use it because the corresponding service is unable to start. Here is what the terminal has to say about it:
Code:userx@nobara-pc:~$ sudo systemctl start php-fpm
Job for php-fpm.service failed because the control process exited with error code.
See "systemctl status php-fpm.service" and "journalctl -xeu php-fpm.service" for details.
userx@nobara-pc:~$ sudo systemctl status php-fpm
i php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
10-timeout-abort.conf
Active: failed (Result: exit-code) since Fri 2024-05-10 15:09:11 -03; 3s ago
Process: 15879 ExecStart=/usr/sbin/php-fpm --nodaemonize (code=exited, status=78)
Main PID: 15879 (code=exited, status=78)
CPU: 16ms
may 10 15:09:10 nobara-pc systemd[1]: Starting php-fpm.service - The PHP FastCGI Process Manager...
may 10 15:09:11 nobara-pc php-fpm[15879]: [10-May-2024 15:09:11] ERROR: failed to open configuration file '/etc/php-fpm.conf': Permission denied (13)
may 10 15:09:11 nobara-pc php-fpm[15879]: [10-May-2024 15:09:11] ERROR: failed to load configuration file '/etc/php-fpm.conf'
may 10 15:09:11 nobara-pc php-fpm[15879]: [10-May-2024 15:09:11] ERROR: FPM initialization failed
may 10 15:09:11 nobara-pc systemd[1]: php-fpm.service: Main process exited, code=exited, status=78/CONFIG
may 10 15:09:11 nobara-pc systemd[1]: php-fpm.service: Failed with result 'exit-code'.
may 10 15:09:11 nobara-pc systemd[1]: Failed to start php-fpm.service - The PHP FastCGI Process Manager.
userx@nobara-pc:~$Going by what the output here says, I've decided to see what permissions are set for /etc/php-fpm.conf. This is what it says:
Code:userx@nobara-pc:/etc$ ls -l php-fpm.conf
-rw-r--r-- 1 root root 4908 mar 11 21:00 php-fpm.conf
userx@nobara-pc:/etc$This is as far as I got, unfortunately. I know that there is some kind of problem with the permissions for this file, but I don't know what the problem exactly is, and I'm not experience enough in Linux yet to know if I can intuit the issue some other way. I've already tried running chmod 777 on the file, but it did not make a difference.
I'm running Nobara (a Fedora derivative) and I've installed PHP-FPM by doing sudo dnf install php-fpm. If there's anything other info that could be relevant, don't hesitate to ask.
I have installed PHP-FPM in my system, but I am unable to use it because the corresponding service is unable to start. Here is what the terminal has to say about it:
Code:userx@nobara-pc:~$ sudo systemctl start php-fpm
Job for php-fpm.service failed because the control process exited with error code.
See "systemctl status php-fpm.service" and "journalctl -xeu php-fpm.service" for details.
userx@nobara-pc:~$ sudo systemctl status php-fpm
i php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
10-timeout-abort.conf
Active: failed (Result: exit-code) since Fri 2024-05-10 15:09:11 -03; 3s ago
Process: 15879 ExecStart=/usr/sbin/php-fpm --nodaemonize (code=exited, status=78)
Main PID: 15879 (code=exited, status=78)
CPU: 16ms
may 10 15:09:10 nobara-pc systemd[1]: Starting php-fpm.service - The PHP FastCGI Process Manager...
may 10 15:09:11 nobara-pc php-fpm[15879]: [10-May-2024 15:09:11] ERROR: failed to open configuration file '/etc/php-fpm.conf': Permission denied (13)
may 10 15:09:11 nobara-pc php-fpm[15879]: [10-May-2024 15:09:11] ERROR: failed to load configuration file '/etc/php-fpm.conf'
may 10 15:09:11 nobara-pc php-fpm[15879]: [10-May-2024 15:09:11] ERROR: FPM initialization failed
may 10 15:09:11 nobara-pc systemd[1]: php-fpm.service: Main process exited, code=exited, status=78/CONFIG
may 10 15:09:11 nobara-pc systemd[1]: php-fpm.service: Failed with result 'exit-code'.
may 10 15:09:11 nobara-pc systemd[1]: Failed to start php-fpm.service - The PHP FastCGI Process Manager.
userx@nobara-pc:~$Going by what the output here says, I've decided to see what permissions are set for /etc/php-fpm.conf. This is what it says:
Code:userx@nobara-pc:/etc$ ls -l php-fpm.conf
-rw-r--r-- 1 root root 4908 mar 11 21:00 php-fpm.conf
userx@nobara-pc:/etc$This is as far as I got, unfortunately. I know that there is some kind of problem with the permissions for this file, but I don't know what the problem exactly is, and I'm not experience enough in Linux yet to know if I can intuit the issue some other way. I've already tried running chmod 777 on the file, but it did not make a difference.
I'm running Nobara (a Fedora derivative) and I've installed PHP-FPM by doing sudo dnf install php-fpm. If there's anything other info that could be relevant, don't hesitate to ask.