PeterBubresko Posted January 29 Share Posted January 29 I got this message, but I have no idea what to write where. I need a step-by-step guide to get this right. Is it okay to use the php.exe that is in Laragon? In that case, php.exe is in the path and folder: C:\laragon\bin\php\php-7.4.33-Win32-vc15-x64\php.exe Thanks for all your help, below is the image file with the error message: Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/ Share on other sites More sharing options...
requinix Posted January 29 Share Posted January 29 You need to add [the] path [to php.exe] to [the] "php.executables" setting. Open the VS Code settings, find "php.executable", and put the path to your php.exe in there. Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648679 Share on other sites More sharing options...
gizmola Posted January 29 Share Posted January 29 2 hours ago, PeterBubresko said: I got this message, but I have no idea what to write where. I need a step-by-step guide to get this right. Is it okay to use the php.exe that is in Laragon? In that case, php.exe is in the path and folder: C:\laragon\bin\php\php-7.4.33-Win32-vc15-x64\php.exe Yes. It wants a local copy of PHP on your workstation. I do have to point out that PHP 7.4 was end of life 2 years ago now. It would be best if you upgraded to a more current supported version of PHP ( > 8.1 at this point in time). Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648683 Share on other sites More sharing options...
PeterBubresko Posted January 29 Author Share Posted January 29 2 hours ago, gizmola said: Yes. It wants a local copy of PHP on your workstation. I do have to point out that PHP 7.4 was end of life 2 years ago now. It would be best if you upgraded to a more current supported version of PHP ( > 8.1 at this point in time). Point taken Gizmola🫡 PHP on webhotel server is 8.4...🫣🫢 Now I am running 8.4.3 on local webserver too. (shame on me). So now Laragon PHP is upgraded. Thanks for waking me up Gizmola Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648691 Share on other sites More sharing options...
PeterBubresko Posted January 29 Author Share Posted January 29 6 hours ago, requinix said: You need to add [the] path [to php.exe] to [the] "php.executables" setting. Open the VS Code settings, find "php.executable", and put the path to your php.exe in there. Thank you for the solution requinix. I am sure it will work for others, but the problem stil resist for me. I read some about it, and it could be something about adding PHP to the windows path (or something), but i dont understand how to fix it because this Indian guy is talking so bad english and way to fast. Is the correct way using 2 \\ or one, on both the "php.executables": { "PHP8.4.3 ": "C:\\laragon\\bin\\php\\php-8.4.3-Win32-vs17 x64\\php.exe", }, "php.executablePath": "C:\\laragon\\bin\\php\\php-8.4.3-Win32-vs17x64\\php.exe" Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648702 Share on other sites More sharing options...
Solution gizmola Posted January 30 Solution Share Posted January 30 12 hours ago, PeterBubresko said: Thank you for the solution requinix. I am sure it will work for others, but the problem stil resist for me. I read some about it, and it could be something about adding PHP to the windows path (or something), but i dont understand how to fix it because this Indian guy is talking so bad english and way to fast. Is the correct way using 2 \\ or one... If the php.exe executable is in your windows path, you probably won't have to manually add the path to that configuration. In fact you would likely need to delete the value from vscode. 1st to understand what the path environment variable does. When you try and run a program, windows will look for that program in the current directory. If it is not found, then it tries to find it in the path. So by design the path variable should have directories in it, NOT the full pathname to the program. So in your example the path you want to add is: C:\laragon\bin\php\php-8.4.3-Win32-vs17 x64\ Follow these instructions to add the location of your laragon php directory file to your system path: These directions were for Windows 10, but they also work for Windows 11. Make sure you don't overwrite your current path, but instead just edit it by adding the path to your php8x installation. Let us know if that fixes the problem. Make sure you restart Vscode after you have added the laragon path to your windows path variable. 1 Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648730 Share on other sites More sharing options...
PeterBubresko Posted Friday at 11:14 PM Author Share Posted Friday at 11:14 PM On 1/30/2025 at 1:46 AM, gizmola said: So by design the path variable should have directories in it, NOT the full pathname to the program. So in your example the path you want to add is: C:\laragon\bin\php\php-8.4.3-Win32-vs17 x64\ Follow these instructions to add the location of your laragon php directory file to your system path: These directions were for Windows 10, but they also work for Windows 11. Make sure you don't overwrite your current path, but instead just edit it by adding the path to your php8x installation. Let us know if that fixes the problem. Make sure you restart Vscode after you have added the laragon path to your windows path variable. Thanks, Gizmola🥰 You saved my day. Not only this day, but a lot of days with troubleshooting. Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648825 Share on other sites More sharing options...
PeterBubresko Posted Friday at 11:22 PM Author Share Posted Friday at 11:22 PM Moderator: I was looking around and asked myself. Did I post this thread in the wrong place? If so, please place it in the right section and delete what I am writing now. Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648827 Share on other sites More sharing options...
gizmola Posted Saturday at 06:55 PM Share Posted Saturday at 06:55 PM No problem, if we thought it should be moved we would have moved it previously. Glad we were able to help you out. Quote Link to comment https://forums.phpfreaks.com/topic/326669-configure-phpexe-in-vs-code/#findComment-1648865 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.