Open Sauerbrei opened 4 years ago
@Sauerbrei the first error is because the Kernel cannot be located. This could be because you have not correctly mounted your current working directory to the Docker container; or depending on what you named the namespace in src/Kernel.php
you may need to export the APP_KERNEL_NAMESPACE env var. The PHP-PM Symfony bootstrap will try both App\Kernel
and AppKernel
.
Re: cgi-path: you have to specify this as the PHP CGI bin file is not in a consistent location across OSs (macOS brew is: /usr/local/bin/php-cgi, Alpine is: /usr/bin/php-cgi7, CentOS is: /usr/bin/php-cgi etc etc). Depending on your OS you may have to install php-cgi explicitly as it is sometimes packaged separately.
Hi @Sauerbrei any more info about this?
Hey @acasademont I tried what was written above but stumbled upon more errors. After considering the documentation twice and also now, I have had no progress, so I abandon my project with php-pm. Sorry for that.
@Sauerbrei now the error seems more clear, by default php-pm searches for the main symfony kernel at \App\Kernel or \AppKernel. If you have a custom Kernel or in a different namespace you have the APP_KERNEL_NAMESPACE
and APP_KERNEL_CLASS_NAME
to fix it.
So where does your Kernel class live?
@acasademont ok, lets give it a last shot.
So, I am using the default symfony kernel, no changes within the symfony skeleton. My Symfony version is 5.1.2. That means my Kernel lives at App\Kernel
. I already added to my .env
APP_KERNEL_NAMESPACE=App\
APP_KERNEL_CLASS_NAME=Kernel
APP_ENV=dev
APP_SECRET=xxx
Now, the following happens:
$ docker run -v `pwd`:/var/www -p 8080:80 phppm/nginx --bootstrap=symfony --static-directory=public/
/var/www
+---------------------+-------------------+
| bridge | HttpKernel |
| host | 127.0.0.1 |
| port | 8080 |
| workers | 8 |
| app-env | dev |
| debug | 0 |
| logging | 1 |
| static-directory | public/ |
| bootstrap | symfony |
| max-requests | 1000 |
| max-execution-time | 30 |
| memory-limit | -1 |
| ttl | 0 |
| populate-server-var | 1 |
| socket-path | /ppm/run |
| pidfile | /ppm/ppm.pid |
| reload-timeout | 30 |
| cgi-path | /usr/bin/php-cgi7 |
+---------------------+-------------------+
Starting PHP-PM with 8 workers, using StreamSelectLoop ...
Application bootstrap failed. Restarting worker #5506 ...
Application bootstrap failed. Restarting worker #5503 ...
Application bootstrap failed. Restarting worker #5502 ...
Application bootstrap failed. Restarting worker #5508 ...
Application bootstrap failed. Restarting worker #5504 ...
Application bootstrap failed. Restarting worker #5501 ...
Application bootstrap failed. Restarting worker #5505 ...
Application bootstrap failed. Restarting worker #5507 ...
Application bootstrap failed. Restarting worker #5506 ...
Application bootstrap failed. Restarting worker #5503 ...
Application bootstrap failed. Restarting worker #5502 ...
Application bootstrap failed. Restarting worker #5508 ...
Application bootstrap failed. Restarting worker #5504 ...
Application bootstrap failed. Restarting worker #5501 ...
Application bootstrap failed. Restarting worker #5505 ...
Application bootstrap failed. Restarting worker #5507 ...
Application bootstrap failed. Restarting worker #5506 ...
Here is my Repo: https://github.com/Sauerbrei/ppm-test
Thank you for your help :)
If you're using the default kernel location in App\Kernel you should not need to use those env variables, those are only for non-standard Kernel locations/names.
Your repo is fine, very similar to our Symfony 5 project. I believe there must be a problem with the docker image and the folder structure & autoloading...could you try it without docker?
Hm, this is strange...
cd ppm-test
ppm start
> --- Worker 5505 stderr ---
> PCNTL is not enabled in the PHP installation at /usr/bin/php-cgi7.4. See: http://php.net/manual/en/pcntl.installation.php
$ php -m | grep pcntl
> pcntl
$ php-cgi7.4 -m | grep pcntl
> pcntl
What am I doing wrong?
Regarding this tutorial https://serverfault.com/questions/158113/installing-pcntl-module-for-php-without-recompiling
my php tells me, PCNTL is already loaded
Basically, I did these steps:
symfony new ppm-test
cd ppm-test
docker run -v
pwd:/var/www -p 8080:80 phppm/nginx --static-directory=public/
Output:
Tried then to start the server via packages:
composer require php-pm/php-pm-httpkernel
composer require php-pm/php-pm
vendor/bin/ppm start --app-env=dev --logging=0 --debug=1 --workers=8 --port 8099 --cgi-path=
(I have no clue why I have to add
--cgi-path=
in order to bypass an error) Output:My goal is to run ppm and symfony via docker-compose. In first place I just want to get it work :D Help is very welcome :)