loading...

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

3rchuss profile image Jesus Abril ・2 min read

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?.

2. CRTL+SHIFT+P

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: xdebug.org/wizard now hit .
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]
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 xdebug.org and also at VSCode extension page.

Thanks for read, it's my really first post

Posted on by:

3rchuss profile

Jesus Abril

@3rchuss

Self-taught Full Stack Web Developer. Apasionado por javascript!

Discussion

markdown guide
 

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: go.microsoft.com/fwlink/?linkid=83...
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 80
}
]
}

 

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 :)

 

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

 

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.

 

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

 

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

 

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