Skip to content

Configuring xdebug on local develpment environment without docker or workers #1936

@Donatello-za

Description

@Donatello-za

Hi everyone,

As per the title, I would like to try and configure xdebug to run on a local Ubuntu development environment without docker and without workers mode. As basic as it can get. I don't know Go or Caddy so I'm a little new to all this and I can't seem to find the exact documentation explaining how to configure it.

From what I understand xdebug cannot be statically linked and so it doesn't ship with frankenphp so I thought I would try and get it running with my installed version of xdebug.so. If there is another way please point me to the relevant documentation and/or provide some guidance if you have the time.

I installed php 8.3 using this:

sudo apt update
sudo apt install -y software-properties-common
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install php8.3 php8.3-cli php8.3-fpm php8.3-mysql php8.3-sqlite3 php8.3-zip php8.3-gd php8.3-mbstring php8.3-curl php8.3-xml php8.3-xdebug -y

I then configured the Caddyfile like this:

{
	frankenphp {
	    php_ini {
	        zend_extension /usr/lib/php/20230831/xdebug.so
	        xdebug.mode develop,debug
            xdebug.discover_client_host true
            xdebug.client_port 9003
            #xdebug.client_host 0.0.0.0
            xdebug.connect_timeout_ms 200
            xdebug.scream 0
            xdebug.cli_color 1
            xdebug.show_local_vars 1
            xdebug.max_nesting_level 512
            xdebug.remote_handler dbgp
            xdebug.idekey phpstorm
	    }
	}
}

:8083 {
	root src/public/
	encode zstd br gzip
	php_server {
		try_files {path} index.php
	}
}

Note that I'm pointing to the install location of xdebug.so: /usr/lib/php/20230831/xdebug.so

I installed frankenphp using: curl https://frankenphp.dev/install.sh | sh

frankenphp is running in my project's root using: ./frankenphp run

I'm getting the following error but I think I know why: Failed loading /usr/lib/php/20230831/xdebug.so: /usr/lib/php/20230831/xdebug.so: undefined symbol: compiler_globals

I think the reason is that frankenphp expects a specific version of xdebug.so, hence the error. I'm obviously approaching this in the wrong way. Can someone help me out on this please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions