Celeb Glow
news | April 03, 2026

How to run php code in VSCode in Ubuntu 20.04, when it was installed with XAMPP server?

I want to execute php files on VSCode (php was installed with XAMPP server), so I find the executable path of my php with whereis php, after this I got: php: /opt/lampp/bin/php , so on VSCode settings.json file I added:

"php.validate.executablePath": "/opt/lampp/bin/php"

Then when using Code Runner VSCode extension, when trying to right clic and Run Code, I got /bin/sh: 1: php: not found on console.

I wonder how to run php code in VSCode.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy