Author Topic: TIP: How to set up NppExec Plugin to highligh PHP Syntax Errors  (Read 11087 times)

Ricky

  • Full Member
  • ***
  • Posts: 180
Hi friends,

I keep Notepad++ with me in a pendrive and generally I use it in situation when I don't have access to my own system. It gives mes easy way to do small coding and modification. One thing I used to miss in it syntax error highlighting , though it is possible in NPP, not really fancy way but its there. So what you need to do is install NppExec plugin and then setup it to parse php to check errors.

Ofcourse you need to have PHP installed on your computer, easiest way is to install WAMP, XAMP like packages. So you should know where is your php.exe

Now following are the steps you need:
Step 1: Install NppExec Plugin
Goto -- > Plugins --> Plugin Manager --> Select "NppExec" and press INSTALL

Once its installed, you will need to restart Notepad plus plus.

Step 2: Configure NppExec Plugin
Now make sure you have proper path to your php.exe, for me it is :
D:\php\php.exe

Now Goto
Plugins --> NppExec --> Execute

In the box you see type following :

Code: [Select]
"D:\php\php.exe" "-ln"  "$(FULL_CURRENT_PATH)"
Remember, to replace your actual php.exe path.

Now click save and give it name like run@php and done.

Step 3 : Test a code
Now, open any PHP file and test it by pressing :
Ctrl + F6

You should see following message if there is any error in your php script:
Quote
"D:\php\php.exe" "-ln"  "D:\docs\test\my.php"
Process started >>>

Parse error: syntax error, unexpected '.' in D:\docs\test\my.php on line 12
Errors parsing D:\docs\test\my.php
<<< Process finished.
================ READY ================

And you are done.

Note: You need to save your script before testing it.

If you have any question or suggestion then please feel to share here.
« Last Edit: March 06, 2012, 06:43:34 PM by Ricky »

 

X

Do you know?

IfAndBut.com gives you a platform where you can ask questions related to web and internet..
So, why wait..
Join Now!