views:

408

answers:

2

How do I get to see the output of a php compiler in notepad++ ? I see that there is a console output window in notepad++ but nothing gets displayed there.

+1  A: 

In the console dialog, type cmd to get the windows command prompt. Then, to execute a php file, type php -f /path/to/file.php

You can also run arbitrary php snippets using the syntax php -r 'echo phpversion();'

You may need to first navigate to the folder that contains the php executable.

adam
Thanks. Is there any way I can make a specified command run in the console dialog every time by pressing a key? For example, I press F5 and the command is executed. Is this possible ?
coder25
+1  A: 

To test for errors in a PHP file, open up nppexec dialog by pressing F6 and type in

"<full path to php.exe>" "-ln" "$(FULL_CURRENT_PATH)"

save the new script and name it as you feel comfortable. You can assign a shortcut key to execute this script in

settings->Shortcut mapper->Plugin commands

once there, scroll down and search for the script you saved.

For even more convenience, press Shidt+F6 to bring up nppexec's line highlights. Put in %ABSFILE% on line %LINE% and tick the checkbox to enable this filter. You will be able to click the error string to go straight to the line with the problem.

Raveren