79161217

Date: 2024-11-06 02:46:29
Score: 1
Natty:
Report link

Following on from @Scofield's solution for docker, here is a solution for ddev (assuming linux/macOS/WSL):

First, as before create an executable file

sudo touch /usr/local/bin/php
sudo chmod +x /usr/local/bin/php

Second, modify the contents of that file, inserting the following and save:

#!/bin/bash

ddev php $@

Third, add a reference to this newly created file to your settings.json as follows:

"php.validate.executablePath": "/usr/local/bin/php",

This key may already exist with an empty value, in which case, update it to match the above.

When complete the built-in PHP validation and debugging within VS Code should be possible without errors.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Scofield's
  • Low reputation (1):
Posted by: jacobupal