I want to start using PHP Code Sniffer in PhpStorm but I am not sure how I can configure it for my environment.
I connect to a Windows server using RDP, PhpStorm is installed on this box.
My development server is a Centos VM.
Am I correct in thinking that I need to install PHP and PHP Code Sniffer on the Windows Server?
UPDATE
I tried following this https://confluence.jetbrains.com/display/PhpStorm/IDE+and+Project+Settings+in+PhpStorm
When I browse to phpcs and click Validate. I get an error which says that it is not a valid Windows application.
Should there be a batch file in there? The link says:
"Composer will install PHP Code Sniffer under the following path in your project: ./vendor/bin/phpcs and ./vendor/bin/phpcs.bat."
I added the batch file manually from here https://github.com/squizlabs/PHP_CodeSniffer/blob/master/bin/phpcs.bat
Now when I click the Validate button, I get:
#php_bin# is not recognised as an internal or external command
What next?
Do I need PHP on my Windows box?
Related
i have the following server setup:
a DC with DNS [works perfect]
a webserver with GUI [works perfect]
a webserver Core [stuck at PHP installation]
I'm trying to install PHP on the core server. I have a simple site with a php file that shows the phpinfo();. From the GUI webserver I was able to manage to use the gui to do a lot of stuff, but now i'm stuck.
What did i do:
on the core server, i put a php folder and eddited the ini file
On the IIS of the GUI, i manage the Core server and added the module mapping for php. I could not browse (did not get the button witht the 3 points to browse) because its managing the coreserver so i just added the path manualy c:\php\php-cgi.exe
the next step would be to add that php path to the environment variables (path). I did this with powershell. When showing the $env:path, the path of php is added. Also after a reboot, it's still added
when following guides, now i should be able to let the cmd tool tell me what version of php i'm running. I tried php -v, php -m and php --version in command line and in terminal. What gave no errors, but also no other output.
Can someone help me debug this one? The core makes it harder for me because when i did this on a gui, it worked. But then i changed settings like the path environment in gui screens.
Thank you for your time!
I'm new to VS Code and the php world. My experience is more with heavyweight IDE such as Visual Studio. However, I have a need to setup a php environment on my dev machine and am having some trouble getting it to work properly.
My environment is a Win 10 dev machine. I am using VS Code and php ver 5.5. I have properly installed the xdebug extension and verified it is properly installed. I have also installed the php-debug extension in VS Code.
The challenge I'm having and have been unable to find any useful information through google is launching the php website from within VS Code and then being able to debug it.
A few things I have tried, but haven't worked.
I installed the iis-express extension to VS Code which allows for running any folder through iis express. https://marketplace.visualstudio.com/items?itemName=warren-buckley.iis-express
This works, but the website doesn't display properly. IIS returns an error message saying the site is not properly configured. It's apparently missing a mapping or something along those lines.
I followed this blog. http://blog.denouter.net/2015/05/run-php-from-visual-studio-code.html and am able to run the website using the built in php web server.
Installed webmatrix and let the windows platform installer correctly install and wire up iis express to work with php. The same folder works fine when running from webmatrix.
Installed the php-debug extension to VS Code. https://github.com/felixfbecker/vscode-php-debug
Here is what I think I'm missing. I believe I need to launch the website from within VS Code for the debugging to work. I can't figure out how to "launch" the php website from within VS Code. The php-debug extension from VS Code only supports launch. It doesn't support "attach" mode. I suspect this is why when I run the website outside VS Code, the debugger doesn't work. Let me be clear, the debugger is working when I hit F5, it just doesn't ever stop on any breakpoints.
To summarize: How can I launch and debug my php website from within VS Code? I'm looking for a detailed step by step guide.
Thank you
I am the author of vscode-php-debug. You do not need to "launch the website" from inside VS Code. When you start the "Listen for XDebug" configuration from the debug section, VS Code (or rather, my debug adapter) will listen on port 9000 for XDebug. You need to run a web server like Apache, IIS or nginx locally on your PC and configure it to serve PHP files - this has nothing to do with VS Code. Then simply open a web browser and navigate to localhost and XDebug will connect to the debugger, stopping on breakpoints.
The two necessary settings in php.ini are:
xdebug.mode = debug
xdebug.start_with_request = yes
(Do not forget to add the subtitle [XDebug] before the settings.
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 want to run my first php project in eclipse(with help of pet package). When I run my project (index.php) eclipse show an error with below message :
Page Login failed with error. Could not connect to the server.
More information :
When I enter "http ://localhost" in my browser it couldn't find server
I'm using kepler version of eclipse
I'm run eclipse in MAC OSX
I think my local server didn't start or I haven't local server. How can I solve this error? How can run local php server in mac ?
Best Regards
You need to install a server package, something like MAMP. Then you need to configure it in order to be driven by Eclipse, using Xdebug, which is a module for Apache. In order to set up your configuration with Xdebug, take a look here: http://wiki.eclipse.org/Debugging_using_XDebug
I have a iis development server set up and i have just successfully downloaded and installed symfony2 which is placed in the web root of this server and im trying to create a bundle within my project and i seem to be getting this error message in the dos box:
the program cant start because of php5.dll is misisng from your computer. Try reinstalling the program to fix this problem
even though the dll is in the directory of the php folder on the C: drive on my computer.
and yes i entered php app/console generate:bundle into the cmd box.
Any suggestions would be very much appreciated
It seems the PHP was not installed successfully or IIS was not configured correctly for the available PHP.
I would recommend to unistall the previous PHP on IIS and install Microsoft Web Platform Installer first; then search for PHP 5.4> and PHP Manager for IIS in the productions list and add/install them.
This is much safe and reliable than installing php manually, specially that it will do IIS configuration for PHP automatically