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

Octane with FrankenPHP doesn't start when xdebug installed #829

Closed
philbates35 opened this issue Jan 31, 2024 · 8 comments
Closed

Octane with FrankenPHP doesn't start when xdebug installed #829

philbates35 opened this issue Jan 31, 2024 · 8 comments

Comments

@philbates35
Copy link
Contributor

Octane Version

2.3.1

Laravel Version

10.42.0

PHP Version

8.3

What server type are you using?

FrankenPHP

Server Version

1.0

Database Driver & Version

No response

Description

Octane is immediately being killed when using the FrankenPHP Docker image with xdebug installed. When xdebug isn't installed, everything works fine.

Probably one for @dunglas.

Steps To Reproduce

After cloning this repo (which is basically just a fresh Laravel app) and cp .env.example .env, make the following simple change to Dockerfile:

FROM dunglas/frankenphp:1.0-php8.3

RUN install-php-extensions \
    @composer \
-   pcntl;
+   pcntl \
+   xdebug;

# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1

RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini; \
    sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/' $PHP_INI_DIR/php.ini;

ENTRYPOINT ["/bin/sh", "-c" , "composer install && php artisan octane:start --server=frankenphp --host=localhost --port=443 --admin-port=2019 --https"]

Then on the terminal run:

docker-compose up --build
...
php_1  | 91 packages you are using are looking for funding.
php_1  | Use the `composer fund` command to find out more!
php_1  | 
php_1  |    INFO  Server running…
php_1  |   Local: https://localhost:443 
php_1  |   Press Ctrl+C to stop the server
php_1  | 
php_1  | 
php_1  |    WARN  automatic HTTP->HTTPS redirects are disabled
php_1  |    WARN  installing root certificate (you might be prompted for password)
php_1  |    WARN  stapling OCSP
laravel-starter_php_1 exited with code 139

When we don't install xdebug in the Dockerfile though (as is the case on the linked repo), Octane runs indefinitely as expected.

There's nothing in laravel.log so I don't even know where to start debugging this, let me know what you need and I'll be more than happy to help!

@driesvints
Copy link
Member

Will let @dunglas reply here

@dunglas
Copy link
Contributor

dunglas commented Feb 6, 2024

Unfortunately XDebug isn't supported by static-php-cli (that we use to create the static build of FrankenPHP): https://static-php.dev/en/guide/extension-notes.html#xdebug

You'll have to switch to the Docker image of FrankenPHP (or compile it locally) to use XDebug.

@driesvints
Copy link
Member

Thanks @dunglas. Should we add a note about that in the Octane docs maybe?

@dunglas
Copy link
Contributor

dunglas commented Feb 6, 2024

@driesvints Yes! I'll document how to use the Docker version and how to add custom extensions.

@philbates35
Copy link
Contributor Author

philbates35 commented Feb 7, 2024

You'll have to switch to the Docker image of FrankenPHP

@dunglas I'm probably misunderstanding, but isn't that what I'm doing here FROM dunglas/frankenphp:1.0-php8.3? My Dockerfile is just extending the official frankenphp docker image, installing a couple of extensions (including xdebug) then running artisan octane:start which sounds like what you're suggesting should work with xdebug?

@dunglas
Copy link
Contributor

dunglas commented Feb 7, 2024

@philbates35 Indeed, sorry I read too fast. I'll take a look when I'll be back from vacation!

@philbates35
Copy link
Contributor Author

Thanks @dunglas, think it's worth reopening the issue until you've had a look?

@dunglas
Copy link
Contributor

dunglas commented Feb 7, 2024

Yes please. It could even be better to open it on FrankenPHP's own repo!

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

No branches or pull requests

3 participants