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

Xdebug is not working in Laravel Octane & FrankenPHP #905

Closed
cgranados16 opened this issue Jun 10, 2024 · 3 comments
Closed

Xdebug is not working in Laravel Octane & FrankenPHP #905

cgranados16 opened this issue Jun 10, 2024 · 3 comments

Comments

@cgranados16
Copy link

cgranados16 commented Jun 10, 2024

Octane Version

2.4.0

Laravel Version

11.10.0

PHP Version

8.3.8

What server type are you using?

FrankenPHP

Server Version

FrankenPHP v1.2.0 PHP Caddy v2.8.4

Database Driver & Version

No response

Description

I can't get Xdebug to work using the Frankenphp server option in Laravel Octane.

A fresh Laravel install shows this in thephpinfo():
Screenshot 2024-06-09 at 23 37 02

But after following this guide to install Laravel Octane with FrankenPHP: https://laravel.com/docs/11.x/octane#server-prerequisites the Xdebug section is missing from the phpinfo(). It is being caused by this command in the docker-compose.yml file:

SUPERVISOR_PHP_COMMAND: "/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan octane:start --server=frankenphp --host=0.0.0.0 --admin-port=2019 --port=80" 

Removing it causes the Xdebug section to appear again but that also stops Laravel Octane from running.

I don't know if the docs are missing some information but the current latests suggests this should work out of the box. Also FrankenPHP claims to natively support Xdebug.

Steps To Reproduce

I have created a new Laravel Sail repo using this guide https://laravel.com/docs/11.x/installation#sail-on-macos

curl -s "https://laravel.build/example-app" | bash
cd example-app
./vendor/bin/sail up
./vendor/bin/sail artisan migrate

Installed Laravel Octane and FrankenPHP integration following https://laravel.com/docs/11.x/octane#server-prerequisites.

sail up
sail composer require laravel/octane
sail artisan octane:install --server=frankenphp

and added the following to the docker-compose.yml:

services:
  laravel.test:
    environment:
      SUPERVISOR_PHP_COMMAND: "/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan octane:start --server=frankenphp --host=0.0.0.0 --admin-port=2019 --port=80" 
      XDG_CONFIG_HOME:  /var/www/html/config 
      XDG_DATA_HOME:  /var/www/html/data 

finally rebuild and start the container

docker compose down -v
 
sail build --no-cache

sail up
@cgranados16 cgranados16 changed the title Xdebug is not working in Frankenphp Xdebug is not working in Laravel Octane & FrankenPHP Jun 10, 2024
@crynobone
Copy link
Member

https://laravel.com/docs/11.x/octane#frankenphp-via-docker

Static installation doesn't contain Xdebug: #829 (comment)

@driesvints
Copy link
Member

@cgranados16 did that solve your issue?

@cgranados16
Copy link
Author

I see, so the idea is to create a Dockerfile and install the xdebug extension there.
Thanks guys :)

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