Open nuryagdym opened 2 months ago
If you just exit
at a random place in the script, does it still not work?
When I put exit
into the public/index.php
from the start worker is restarting continuously.
I let the first worker start and then put exit
at the start of index.php.
Then I make the first request, this request works because it is already in memory.
Then second request goes into infinite loading, no new logs in container logs, seems like index.php is not run at all.
Weirdly setting xdebug.start_with_request=yes
fixes the issue.
Interesting. If you turn on xdebug logs, does it give any useful information? I wonder if this might be an xdebug bug?
For the first request I see following logs
[281472447540704] Log opened at 2024-08-15 07:40:47.634757
[281472447540704] [Config] INFO: Control socket set up succesfully: '@xdebug-ctrl.281472447540704'
[281472447540704] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION'
[281472447540704] [Config] INFO: Trigger value for 'XDEBUG_SESSION' not found, so not activating
But no zdebug logs for the second request
I'm able to reproduce on a project I'm working on. Disabling xdebug seems to solve it. I'll step through with gdb later and see what causes it—like yours, it seems to be an issue with ending the request.
I tried now without a worker mode, it is working properly when worker mode is disabled.
What happened?
I am new to Frankenphp. I was setting up a new symfony 6.4 project with FrankenPHP and faced issue with xdebug when xdebug.mode=debug. I also check #563 but it seems not to be the same issue.
Environment: image: dunglas/frankenphp:1.1.5-php8.3 (also tried dunglas/frankenphp:1.1.5-php8.2) xdebug: v3.3.2 symfony: 6.4.* runtime/frankenphp-symfony: 0.2.0
For development environment I set num of workers to 1 and
FRANKENPHP_LOOP_MAX=1
.What happens is, the first request is served without issue, the second request loading goes into endless loading. I compared container logs with
xdebug.mode=off
(working one) andxdebug.debug=debug
. The difference is that as you can see from the screenshot, there is norestarting
log on the left side (whenxdebug.debug=debug
).To debug the issue I tried to setup the same environment but without Symfony, just
index.php
. In this case I did not face the same issue.Steps to reproduce:
RUN install-php-extensions \ xdebug
COPY Caddyfile /etc/caddy/Caddyfile COPY ./project /app COPY --link ./xdebug.ini /usr/local/etc/php/conf.d/50_xdebug.ini
WORKDIR /app
zend_extension=xdebug xdebug.mode=debug xdebug.discover_client_host=1 xdebug.idekey=PHPSTORM xdebug.client_host=host.docker.internal error_log=/app/var/log/php_error.log
{
Debug
}
:80
log route { root * public/
Add trailing slash for directory requests
}
composer require runtime/frankenphp-symfony
extra
declare(strict_types=1);
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route;
class HomeController extends AbstractController { public function __construct( ) { }
}
Relevant log output