Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP-FPM failed to start: Permission denied (13) #469

Open
Ex0danify opened this issue Apr 23, 2024 · 5 comments
Open

PHP-FPM failed to start: Permission denied (13) #469

Ex0danify opened this issue Apr 23, 2024 · 5 comments

Comments

@Ex0danify
Copy link

Ex0danify commented Apr 23, 2024

Hi there,
I'm struggling to get the symfony-cli local dev webserver running for while now, my search on the interwebz sadly did not yield any results regarding my issue, so I hope someone can help here.

I installed the symfony-cli package from the official repos on to my Fedora 39 Desktop.
The version I currently have installed is

Symfony CLI version 5.8.15

After switching to my project directory I tried starting the webserver with the command symfony server:start. This is error message I'm getting:

 [ERROR] PHP-FPM failed to start:                                                                                       
 failed to open configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.17.ini': Permission denied (13)                                                                                         
 failed to load configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.17.ini'                                                                                                                 
 FPM initialization failed    

I checked the directory from the error and indeed, it's empty. So I copied my local config file from /etc/php-fpm.conf to said location and renamed it accordingly to match the filename from the error, but after trying to start the server again, the file simply gets deleted and the error appears.

I checked my local php version with symfony local:php:list:

+---------+-----------+---------+--------------+-------------+---------+---------+
| Version | Directory |   PHP   |     PHP      |     PHP     | Server  | System? |
|         |           |   CLI   |     FPM      |     CGI     |         |         |
+---------+-----------+---------+--------------+-------------+---------+---------+
| 8.2.17  | /usr      | bin/php | sbin/php-fpm | bin/php-cgi | PHP FPM | *       |
+---------+-----------+---------+--------------+-------------+---------+---------+

I have two logs inside my ~/.symfony5/log folder:

47b04f04e41268df530018188722264ccb01100f.log:

{"level":"debug","source":"server","source":"PHP","time":"2024-04-23T21:33:01+02:00","message":"Reloading PHP versions"}
{"level":"debug","source":"server","source":"PHP","time":"2024-04-23T21:33:01+02:00","message":"Using PHP version 8.2.17 (from default version in $PATH)"}
{"level":"info","source":"server","source":"PHP","php":"8.2.17","path":"/usr/sbin/php-fpm","port":33331,"time":"2024-04-23T21:33:01+02:00","message":"listening"}

and

47b04f04e41268df530018188722264ccb01100f/53fb8ec204547646acb3461995e4da5a54cc7575.log:

[23-Apr-2024 21:33:01] ERROR: failed to open configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.17.ini': Permission denied (13)
[23-Apr-2024 21:33:01] ERROR: failed to load configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.17.ini'
[23-Apr-2024 21:33:01] ERROR: FPM initialization failed

Offcourse I already tried reinstalling the package and deleting the ~/.symfony5 folder already, but that does not change anything, the .symfony5 folder just gets recreated, the error stays the same.

Any advice on my problem? I would be grateful for anyone to help me out here, I really want to continue developing my project.
Thanks for any response in advance!

@tucksaun
Copy link
Contributor

This file is supposed to be generated by the CLI but failing to write it is supposed to make the start fail with some details 🤔

Can you try running symfony server:start again but with the --daemon=false -vvv flags and send the logs?

@Ex0danify
Copy link
Author

Thanks for the fast reply tucksaun, really appreciate it!
Here is the output from the command you wanted me to run:

ex0@LuxRipper [14:36:01] [~/Git/sky-api] [master *]
-> % symfony server:start --daemon=false -vvv
Following Web Server log file (/home/ex0/.symfony5/log/47b04f04e41268df530018188722264ccb01100f.log)
Following PHP-FPM log file (/home/ex0/.symfony5/log/47b04f04e41268df530018188722264ccb01100f/53fb8ec204547646acb3461995e4da5a54cc7575.log)
{"level":"warn","time":"2024-04-24T14:36:04+02:00","message":"permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json\": dial unix /var/run/docker.sock: connect: permission denied"}
{"level":"error","time":"2024-04-24T14:36:04+02:00","message":"Unable to start PHP-FPM"}
                                                                                                                        
 [ERROR] PHP-FPM failed to start:                                                                                       
 failed to open configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.1          
 7.ini': Permission denied (13)                                                                                         
 failed to load configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.1          
 7.ini'                                                                                                                 
 FPM initialization failed                                                                                              
                                                                                                                        

                                                                                  
  PHP server exited unexpectedly: command "PHP-FPM" failed early: exit status 78  
                                                                                  

Error trace:
                                  
  PHP server exited unexpectedly  
                                  

github.com/symfony-cli/symfony-cli/local/php.(*Server).Start.func4
        github.com/symfony-cli/symfony-cli/local/php/php_server.go:200
github.com/symfony-cli/symfony-cli/commands.init.func25.2
        github.com/symfony-cli/symfony-cli/commands/local_server_start.go:235
runtime.goexit
        runtime/asm_amd64.s:1695

Previous error:
                                                  
  command "PHP-FPM" failed early: exit status 78  
                                                  

github.com/symfony-cli/symfony-cli/local/php.(*Server).Start.func4
        github.com/symfony-cli/symfony-cli/local/php/php_server.go:200
github.com/symfony-cli/symfony-cli/commands.init.func25.2
        github.com/symfony-cli/symfony-cli/commands/local_server_start.go:235
runtime.goexit
        runtime/asm_amd64.s:1695

Previous error:
                                                  
  command "PHP-FPM" failed early: exit status 78  
                                                  

github.com/symfony-cli/symfony-cli/local.(*Runner).Run
        github.com/symfony-cli/symfony-cli/local/runner.go:185
github.com/symfony-cli/symfony-cli/local/php.(*Server).Start.func4
        github.com/symfony-cli/symfony-cli/local/php/php_server.go:200
github.com/symfony-cli/symfony-cli/commands.init.func25.2
        github.com/symfony-cli/symfony-cli/commands/local_server_start.go:235
runtime.goexit
        runtime/asm_amd64.s:1695

I hope this help to find the issue I have in one or another way.

@Ex0danify
Copy link
Author

I noticed a permission issue regarding docker, that was, because my user was not in the docker group. I added him to it, but the error stays pretty much the same:

Following Web Server log file (/home/ex0/.symfony5/log/47b04f04e41268df530018188722264ccb01100f.log)
Following PHP-FPM log file (/home/ex0/.symfony5/log/47b04f04e41268df530018188722264ccb01100f/53fb8ec204547646acb3461995e4da5a54cc7575.log)
{"level":"error","time":"2024-04-24T19:35:00+02:00","message":"Unable to start PHP-FPM"}
                                                                                                                        
 [ERROR] PHP-FPM failed to start:                                                                                       
 failed to open configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.1          
 7.ini': Permission denied (13)                                                                                         
 failed to load configuration file '/home/ex0/.symfony5/php/47b04f04e41268df530018188722264ccb01100f/fpm-8.2.1          
 7.ini'                                                                                                                 
 FPM initialization failed                                                                                              
                                                                                                                        

                                                                                  
  PHP server exited unexpectedly: command "PHP-FPM" failed early: exit status 78  
                                                                                  

Error trace:
                                  
  PHP server exited unexpectedly  
                                  

github.com/symfony-cli/symfony-cli/local/php.(*Server).Start.func4
        github.com/symfony-cli/symfony-cli/local/php/php_server.go:200
github.com/symfony-cli/symfony-cli/commands.init.func25.2
        github.com/symfony-cli/symfony-cli/commands/local_server_start.go:235
runtime.goexit
        runtime/asm_amd64.s:1695

Previous error:
                                                  
  command "PHP-FPM" failed early: exit status 78  
                                                  

github.com/symfony-cli/symfony-cli/local/php.(*Server).Start.func4
        github.com/symfony-cli/symfony-cli/local/php/php_server.go:200
github.com/symfony-cli/symfony-cli/commands.init.func25.2
        github.com/symfony-cli/symfony-cli/commands/local_server_start.go:235
runtime.goexit
        runtime/asm_amd64.s:1695

Previous error:
                                                  
  command "PHP-FPM" failed early: exit status 78  
                                                  

github.com/symfony-cli/symfony-cli/local.(*Runner).Run
        github.com/symfony-cli/symfony-cli/local/runner.go:185
github.com/symfony-cli/symfony-cli/local/php.(*Server).Start.func4
        github.com/symfony-cli/symfony-cli/local/php/php_server.go:200
github.com/symfony-cli/symfony-cli/commands.init.func25.2
        github.com/symfony-cli/symfony-cli/commands/local_server_start.go:235
runtime.goexit
        runtime/asm_amd64.s:1695

@DavidCodecolliders
Copy link

DavidCodecolliders commented May 3, 2024

Hi I meet exactly the same issue. I've tried with Docker and Podman.. same. Tried ith sudo also. I've you found a solution ?

@Ex0danify
Copy link
Author

Hi I meet exactly the same issue. I've tried with Docker and Podman.. same. Tried ith sudo also. I've you found a solution ?

Sadly not. Maybe tucksaun will have an answer for us in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants