DEV Community

Jesus Abril
Jesus Abril

Posted on

How to set up PHP executable path in VSCode (XAMPP user's)

Did you find this message when creating a PHP file in VSCode?

Cannot validate since no PHP executable is set. Use the setting 'php.validate.executablePath' to configure the PHP executable.

1. First of all

Open settings.json and paste this line "php.validate.executablePath": "your_unit:/xampp/php/php.exe", paste this in the last line of your settings.json.
Ok, the annoying message does not pop up anymore, and now?.

That's all

not kidding really😄 but... we want to debug PHP also in VSCode right?.


type ext install PHP Debug and install the first match.

Run XAMPP server, create a php file like test.php with phpinfo(); open it in your browser localhost/test.php copy the HTML source (what you see) and paste it into here: now hit analise my phpinfo() output.
Follow the instruction and download the .dll file, install it in the folder your_unit:\xampp\php\ext .

3. Almost done!

Now open you php.ini from XAMPP and paste the code in the very last line

xdebug.remote_enable = 1
xdebug.remote_autostart = 1
zend_extension = "you_unit:\xampp\php\ext\downloadedfile.dss

Save it!

Now, restart XAMPP and VSCode and you should be done!

Last thing

Wondering how it works?
Open your project on your browser, set a stop point in VSCode and see the magic!

You can follow the documentation at and also at VSCode extension page.

Thanks for read, it's my really first post

Discussion (12)

jaimefo1 profile image

Hola Jesús, me ha surgido un problema con VS Code, y es que ha dejado de maracar los bloques para colapsar, sólo en php, en js o html funciona, tienes idea de qué puede ser, he reinstalado, pero me coge los mismo settings, no cambia nada, el caso es que cuando lo inicio hay un momento al principio que aparecen las flechas de colapsar, pero se van en seguida, solo para php
un saludo :)

3rchuss profile image
Jesus Abril Author

Hola Profe, pues creo que tienes un conflicto de plugins, prueba a deshabilitar los que no estés utilizando por el momento.

amir_gharajedaghi profile image

// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
"version": "0.2.0",
"configurations": [
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 80

ntalamdotcom profile image

it Works... thanks

jreegene profile image

ext install PHP Debug does not fetch anything to be installed. Any issues similar

theonlywisdom profile image
Wisdom Akwoyere Baah

Perhaps you could try installing the PHP Debug extension, then take it from there.

3rchuss profile image
Jesus Abril Author

Maybe incompatibility with other plug-ins.
Try to install the latest version and deactivate other php plug-ins.

agbams profile image
Ugochukwu Agbams

Hey @3rchuss , thanks for this wonderful piece of work. It really helped me out, and I now have everything up and running with my vs code in connection with xampp.

3rchuss profile image
Jesus Abril Author

Great. Im glad that this helped you out.
Thank you.

jswizard profile image
Ogbuagu Francis

very helpful thanks

harshitharas profile image
Harshitha Rasamsetty

What does "set a stop point in VSCode" mean?

theonlywisdom profile image
Wisdom Akwoyere Baah

A break point, I guess.