I use Windows10 home and I'm having this notification in Visual Studio code:
Cannot validate since no PHP executable is set. Use the setting
'php.validate.executablePath' to configure the PHP executable.
I don't want to have it, so I went to preferences > settings.JSON and added:
{
"php.validate.executablePath": null
}
I saved, closed the program, and then opened a PHP file but I still get the notification.
How could I totally remove that notification?
The reason I want to remove it is because I usually don't do PHP development on windows, rather, on Linux and I want to keep my Windows environment minimal without installing PHP on it.
Edit: I don't have any extensions on VSCODE besides "ESLint" for JavaScript.
Related
I run php files in Apache server. Also, i've added in user settings the code as
"php.validate.executablePath": "C:\wamp64\bin\php\php7.0.10\php.exe",
Still, i cant run php files? Help;
You have to install php debug extension in visual studio code
Try this
https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug
or you can try below one using php xdebug extension(this works for me)
http://www.accella.net/knowledgebase/debugging-php-with-visual-studio-code/
As the name suggests, php.validate.* directives are used to configure linting (i.e. parsing PHP source code to detect syntax errors):
Linting
VS Code uses the official PHP linter (php -l) for PHP language diagnostics. This allows VS Code to stay current with PHP linter improvements.
To run PHP scripts from within the editor you have a number of choices or none at all depending on what you want to do exactly. You can run command-line scripts from the integrated terminal, with an extension like Runner or Code Runner. As far as I know there's no way builtin way to lauch a browser in the preview pane that reloads as you save if that's what you mean. And you can certainly configure a debugger.
I have VSCode installed, but don't seem to have php - i.e. there is no "php.exe" anywhere on my computer. No guides that I can find on the web about setting VSCode up for PHP suggests that I need to download and install php itself seperately (only debuggers and linters)... my question is:
Do I need to install PHP seperately? Should I have had to do this, or is there a bug in my VSCode installation...
Yes you need to install PHP from the php website and then tell VSCode where PHP.exe is located.
VSCode is an editor not an interpreter.
I think if you install PHP at the default location VSCode will automaticly pick it up but if not you need to specify its path in options.
If you install XAMPP you will get apache,php and mySql in one installation.
EDIT: an interpreter is software that translated your code(in your case PHP) into code that the CPU can understand and then executes.
#kpollock it' not you. Yes, it should seem obvious that the language should be installed manually or separately, so you should have gotten that part, sorry. But no, there doesn't seem to be information anywhere about defining the underpinnings. This "understanding" seems to be left to the individual through research as you're doing.
After I installed PHP I manually set my environment PATH to include the PHP folder. OR in VS Code you can go to menu>File>Preferences>User Settings, the settings are maintained as a JSON object (unlike VS) and there is a PHP section for the .exe path.
Since you mentioned Node, you may not have installed Node.js manually. (I don't know if Node comes with VS Code either.) It might have come in with a VS2015 extension like Gulp or some other higher-level functionality, or maybe it was an installation option with VSC. If you can't use node or npm from a console, set your environment PATH to include it.
I recently download PHP from here to install on Windows. I extracted all the contents of the file into a file called php located in C:\php. I added the path to the environment variables. I tried to run php -v on the command prompt but I get nothing, not even an error message. Am I missing something? Something wrong with the installation?
In order for PHP to be properly installed, I needed to have the Visual C++ Redistributable for Visual Studio 2012 installed. I did not have it installed but after all said and done I tried verifying if PHP is installed and it was.
Php is server side script that parses php code and return html output for your browser.
Get a web server and enable php. Try running php code on web server. point your browser to the location.
There are many free web servers available.
I have installed trial version of PhpStorm 7 on my Windows 7 64 bit.
Php Storm is installed in "C:\Program Files (x86)\JetBrains\PhpStorm 7.0\bin\PhpStorm.exe" and my Xampp server in in E:\xampp.
I go to set php interpreter but PhpStorm don't find it.
I opened phpinterpreter windows and choose directory E:\xampp\php but I receive more error like this
Php Startup: Unable to load dynamic lybrary "\xampp\php\ext\php_xxxxxx.dll"......
It seems that PhpStorm 7 trunks the path excluding the disc and cannot find the installation of php over xampp directory.
I forced write correct value in C:\Users\currentuser\.WebIde70\config\options\php.xml , but I have same result
P
hp version: Not installed
Debugger: Not installed
but I have both installed and running.
What should I do to correct the problem?
Thanks very much
This worked for me, however I'm in PhpStorm 8 and the layout is entirely different. I'll still pop this here in case someone else needs these instructions.
Install your prefered PHP from here: http://windows.php.net/ (It doesn't need to be in your PATH, just pop it anywhere)
In PhpStorm, go to File -> Settings
In settings go to Languages & Frameworks -> PHP
Click the ellipsis next to Interpretter (this opens a new window)
Click the plus button in the top left and choose "Other Local"
Set the PHP exectuable to wherever you put your download above. It just needs to see php.exe
That's it. I've been using that to run Composer from PhpStorm... though I'm not convinced by the results.
As an alternative I would highly recommend using Vagrant for your PHP needs. You don't need PHP in Windows at all, and I've been developing this way for about 2 years. PhpStorm's remote support (including Vagrant, SSH and Remote Interpreter) is now excellent. I think the only thing I've been irritated by is PHPUnit Code Coverage is still broken.
My Xdebug works fine when I use eclipses' internal browser but when I use it in an external browser apache crashes.
I am using xampp and on windows 7 64 bit. If someone needs more information let me know.
For some reason if I have the variables tab open in the php debugger in eclipse it crashes apache. So to stop it I just can't have variables tab open while debugging. So this avoids the problem but doesn't fix it. I would like to be able to have this tab. Any suggestions?
It is possible that the XDebug build and type does not match your apache & php build and type...
Apache compiled with VS.NET 2008 (VC9) for 32bit and using PHP as a module would require XDebug: 32bit, VC9, Thread Safe.
http://xdebug.org/download.php
Also, you could test another WAMP package that comes with XDebug (for example WampDeveloper) and if it also does not work for you, it's probably not a build mismatch issue.
Hey I got this working
Eclipse 3.6.1 (because on later versions key shortcut for putting line comment don't work)
Xampp 1.7.4
Xdebug 2.1.2
The trick is to change php from VC6 to VC9 and then it just works correctly.
BTW. It's the variables panel that causes xdebug to crash apache on php VC6.
Remember to get VC9 version of xdebug for new php AND if you put your new php in directory other than
\xampp\php, then on phpinfo(); you'll see that there's no php.ini loaded so just rename old php (co you can swich them from one to other anytime) and put new php in the same directory in which original php was in "\xampp\php" and copy your php.ini (because paths doesn't change). Also remember to obtain any additional php extensions you've been using in VC9 version for new php and put them in "\xampp\php\ext"
I can confirm most of what t0meck said. Except I've moved up to xampp-win32-1.7.7-VC9 which has PHP 5.38. Taking the phpinfo() results from that to Xdebug's custom installation analyzer, it specifies the php_xdebug-2.1.2-5.3-vc9.dll, but the problem isn't entirely eliminated. As I've documented in my 'notes to self' page, the following is working for me.
After following the above procedure, the 'run as' should work on the first try, but the 'debug as' may crash Apache at every attempt. This is an issue that has driven many people to severe distraction. There is an apparent bug exposed using the debug perspective. At the top center of the perspective is a window with two tabs, the variable view and the breakpoint view. Usually, Apache crashes only when the variable view is highlighted, so highlight the breakpoint view instead. Then set a breakpoint on your project. Now, if you are one of the chosen, you will be able to step through the script using the debugger, but when you switch to the variable view it may still crash Apache. What a drag. Repeat the process and the next time you should actually see the variables and the problem will magically go away, until you restart the project. Just repeat the procedure and be satisfied with being one of the lucky ones.
Don't know if this help, I have same kind of issue, but it relate to array depth xdebug >handle in Variables view. And you can change it. Widnow > Preferences > PHP > Debug > >Installed Debug > Xdebug > Configure enlarge the "Max array depth" solved my issue.
http://bugs.xdebug.org/view.php?id=658#c1767
Just set it to 10 or bigger and it should work