Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a PHP syntax checker for Notepad++?

Tags:

php

notepad++

Is there a PHP syntax checker plugin for Notepad++?

Please don't answer "Use another editor instead"

like image 511
edt Avatar asked Jun 10 '11 21:06

edt


People also ask

How do I code PHP in Notepad?

In Notepad, add . php to the end of the filename and enclose in double quotations. This ensures the file will not be converted into a basic text file by Notepad.

How do I check my PHP code?

Check PHP Version by Running PHP Codephp echo 'PHP version: ' . phpversion(); Create the file using a text editor like gedit or Notepad, and upload it to your website's document root directory.

Can we do PHP in Notepad ++?

PHP programs can be written on any editor, such as - Notepad, Notepad++, Dreamweaver, etc. These programs save with . php extension, i.e., filename. php inside the htdocs folder.


2 Answers

Try NppExec plugin for Notepad++. Using it create a command to be something like this:

cmd.exe /K c:\your\path\to\php.exe -l "YOUR_FULL_FILE_NAME" 

Instead of YOUR_FULL_FILE_NAME you should use appropriate Notepadd++ macro -- I think it is $(FULL_CURRENT_PATH) but double check with NppExec manual (installs together with plugin).

P.S. But any IDE will be better for sure (I'm using PhpStorm). If IDE is too heavy for your PC then look for php-oriented editors, like Blumentals RapidPHP etc (it's lighter than full IDE but may have all really important features).

like image 190
LazyOne Avatar answered Oct 17 '22 00:10

LazyOne


As LazyOne said above, you can use NppExec which you can install using the plugin manager (Plugins>Plugin Manager>Show Plugin Manager) You'll also need to have PHP installed. Lastly, the command I use to do PHP syntax checking with NppExec is

"C:\Program Files (x86)\PHP\php.exe" -l $(FULL_CURRENT_PATH) 
like image 38
apocryphalauthor Avatar answered Oct 17 '22 00:10

apocryphalauthor