# Local provides a version of php, correct? Please help me....!

**URL:** <https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875>\
**Category:** Support\
**Created:** [September 3, 2023, 7:48am UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875 "2023-09-03T07:48:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![katie09](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@katie09](https://community.localwp.com/u/katie09)\
**Post date:** [September 3, 2023, 7:48am UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/1 "2023-09-03T07:48:53Z")

</div>

### What issue or error are you experiencing?

I am having difficulty regarding php files being recognized in the editor I am using and it keeps saying I have to specify the path to the php executable (which I still have yet to find). I have tried researching other forums associated with my code editor, associated with wordpress, and just online in general and have come up with NOTHING useful or that has even come close to fixing the issue… So basically my code editor thinks php is not valid or does not exist or whatever (please forgive me for not knowing how to properly word some things for I am fairly new to all of this stuff) – and I thought that Local WP provided php and mysql…wouldn’t that mean if Local is open and running, that my editor should be able to detect that php exists when I have a folder open for a wp site created on Local? Or am I way off base with this?

* * *

### What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

The code editor I am using is VS Code and I am using the most current version of Local. I have tried adding the Intelliphesense (not sure I spelled that correctly) and the Intellisense plugins, neither worked (the 1st one gives me errors when activated and I will attach a screenshot of this) - I have tried disabling the built-in php stuff, that didn’t work either - I have tried locating the php executable file in I don’t even know how many ways now, and always come up empty handed - I don’t even know what else I have done anymore…but I have done piles and piles of varius methods and suggestions, but here I am still looking (and I am runnin out of time).  
Asking this forum is my last ditch effort to figure this out before I fail the class I am in rt now, so I hope someone out there can help… I will attach the errors I am recieving ----hopefully someone can guide me in the right direction… thank you in advance for your time…

* * *

### System Details

- **Local Version:** the most recent version

- **Operating System (OS) and OS version:** windows 10 on an HP Probook

* * *

### Local Logs

Attach your Local Logs here ([Help Doc - Retrieving Local’s Log](https://localwp.com/help-docs/troubleshooting/retrieving-locals-log-file/))

* * *

[local-lightning.log](https://community.localwp.com/uploads/short-url/5xPDRP5lqhYIQY0zN5LV0JRX8t7.log) (655.4 KB)

 ![php error 3](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/f/f/ff5308d9b22eddba4cf8aefc3e647d84015f6266.png)  
 ![php error 4](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/3/4/346a6c661b9d30d6261936d7d0c1c454c3764893.png)  
 ![php error 1](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/b/8/b8555c5c8c40015c5455342059806beba56694d5.png)  
 ![php error 2](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/3/b/3bd9c974b23ed247928a97b03d6905646eae6743.png)

_ **Security Reminder** _  
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

---

<div class="post-metadata">

**Author:** ![katie09](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@katie09](https://community.localwp.com/u/katie09)\
**Post date:** [September 3, 2023, 9:35am UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/2 "2023-09-03T09:35:47Z")

</div>

I know the images are showing vs code, but my problem always winds back to accessing php and supposedly php should be directly related to or within Local… i couldn’t get any answers anywhere else, so I am trying here as a last ditch effort…

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [September 5, 2023, 7:52pm UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/3 "2023-09-05T19:52:53Z")

</div>

Hi @katie09

Sharing my comment on a similar post here where the same error was popping up. If you try using our Xdebug + VS Code extension, that might help get you going. More details here:

> [@Sudden PHP configuration error on VS Code](https://community.localwp.com/t/sudden-php-configuration-error-on-vs-code/38779/4):
>
> Hi @Leta If you click on the Add Ons tab in Local, there is an Extension for Xdebug + VS Code. [Here is a screenshot](https://share.getcloudapp.com/7KuXevjd) Even though you might not be trying to use XDebug, in the process of adding the configuration to VSC, it should point VSC to a server run by XDebug, which in turn points to PHP. Xdebug is acting kind of like a middleman to the PHP. You could also try to set the php.validate.executablePath to the actual path of the PHP binary we ship - here’s that info: For Windows: Bundled PH…

---

<div class="post-metadata">

**Author:** ![emmtre](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/emmtre/32/15116_2.png) [@emmtre](https://community.localwp.com/u/emmtre)\
**Post date:** [September 5, 2023, 10:42pm UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/4 "2023-09-05T22:42:04Z")

</div>

@katie09

I’m running VS Code on macOS and I have to do three things.

1. Create a symbolic link so the php executable is in the path.

`sudo ln -sf /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin/bin/php /usr/local/bin/php`

Or depending on which php version you are using.

`sudo ln -sf /Users/Name/Library/Application\ Support/Local/lightning-services/php-8.2.8+0/bin/darwin/bin/php /usr/local/bin/php`

1. Tell VS Code where to find the the Local php executable.

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

This is the symbolic link to the php executable I created in step 1.

1. Add the WordPress installation path so Intelephense can index.

I guess you have to do something similar on Windows 10.

> **[VS Code Settings](https://share.cleanshot.com/2tGk6TxrnycmstJqGbyb)**
>
> Screenshot uploaded to CleanShot Cloud

> **[VS Code Settings](https://share.cleanshot.com/BQzdD34JrlzLF2nfy9Jl)**
>
> Screenshot uploaded to CleanShot Cloud

---

<div class="post-metadata">

**Author:** ![emmtre](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/emmtre/32/15116_2.png) [@emmtre](https://community.localwp.com/u/emmtre)\
**Post date:** [September 5, 2023, 11:24pm UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/5 "2023-09-05T23:24:49Z")

</div>

@katie09

1. I think you have to add `wordpress` to Intelephense stubs settings.

> **[VS Code Settings](https://share.cleanshot.com/MLLdLWvxxfyY9DbmksJJ)**
>
> Screenshot uploaded to CleanShot Cloud

---

<div class="post-metadata">

**Author:** ![emmtre](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/emmtre/32/15116_2.png) [@emmtre](https://community.localwp.com/u/emmtre)\
**Post date:** [September 6, 2023, 8:38am UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/6 "2023-09-06T08:38:59Z")

</div>

> [@emmtre](#):
>
> 1. Create a symbolic link so the php executable is in the path.
> 
> `sudo ln -sf /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin/bin/php /usr/local/bin/php`

Sorry, I was too fast and copied the link to the the php executable from some old notes. If you are running Apple Silicon you have to replace `darwin` with `darwin-arm64` in the link.

`sudo ln -sf /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/bin/php /usr/local/bin/php`

---

<div class="post-metadata">

**Author:** ![katie09](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@katie09](https://community.localwp.com/u/katie09)\
**Post date:** [September 6, 2023, 5:22pm UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/7 "2023-09-06T17:22:26Z")

</div>

awesome! thank you so much! exactly what I needed to know and have been endlessly searching for!! I appreciate your time

---

<div class="post-metadata">

**Author:** ![katie09](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@katie09](https://community.localwp.com/u/katie09)\
**Post date:** [September 6, 2023, 5:23pm UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/8 "2023-09-06T17:23:25Z")

</div>

Thank you very much for your time and your instructions! I was able to correct the problem!!

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [December 5, 2023, 5:24pm UTC](https://community.localwp.com/t/local-provides-a-version-of-php-correct-please-help-me/38875/9 "2023-12-05T17:24:25Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
