DEV Community

Cover image for XDebug, VScode, ubuntu
Mohammad Reza
Mohammad Reza

Posted on • Edited on

12 2

XDebug, VScode, ubuntu

For installing the XDebug in ubuntu and use it from VScode follow these steps

1.Step one

Run this command

sudo apt install php-xdebug
Enter fullscreen mode Exit fullscreen mode

2.Step two

Run this command

sudo nano /etc/php/7.4/mods-available/xdebug.ini
Enter fullscreen mode Exit fullscreen mode

Then go to the end of the file and add these lines

[xdebug]
zend_extension=/usr/lib/php/20190902/xdebug.so
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000

Enter fullscreen mode Exit fullscreen mode

For finding the path of the xdebug (/usr/lib/php/20190902/xdebug.so)
you can run this command

locate xdebug.so
Enter fullscreen mode Exit fullscreen mode

3.Step three

Open the configuration file of Xdebug by clicking ‘Add Configuration…’ from the menu Run and set the necessary configuration according to the xdebug.ini file.
It will become sth like this

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}
Enter fullscreen mode Exit fullscreen mode

Done
Alt Text

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (2)

Collapse
 
theplacid profile image
theplacid

thanks alot!

Collapse
 
azibom profile image
Mohammad Reza

De rien! :-)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay