Changes

Jump to navigation Jump to search

PHP PORTABLE IDE: Introduction

5 bytes removed, 12:51, 8 December 2010
Fix grammatical problems; clarify sentences.
     
|
* Portable ; run from UDB memory stick
* Edit PHP web pages running on local server (Uniform Server)
* Debug PHP web pages running on local server (Uniform Server)
Some time ago I was asked the following question "''Is there an easy way to develop and run PHP CLI scripts from a USB memory stick''"?
It transpires this user was learning PHP and wanted an easy way to run code snippets. Reason The reason user had for running from a USB stick, he/she they did not want to install PHP and a full-blown IDE on their PC.
My reply was, use Notepad++ , install the NppExec plugin and add core binaries from PHP. To run currently displayed script , write a small NppExec command script. You can create a shortcut key that runs this command script. For greater flexibility , consider adding XDebug which will allow you to debug both CLI and server side scripts.
Response The response was not unexpected! "''Can you supply a complete idiots guide''?"
== Guide Tutorial Breakdown ==
This guide is split across several pages each . Each page builds on previous pages to construct the final IDE. Pages and topics covered are as follows:
{|
|
This page covers the following:
* How to [[PHP PORTABLE IDE: NppExec Configuration#Copy and Paste (console window) | copy and paste]] in the console window.
* Use [[PHP PORTABLE IDE: NppExec Configuration#Environment variables | environment variables]] for absolute paths to Notepad++'s folders.
* Using the above Environment variables [[PHP PORTABLE IDE: NppExec Configuration#Run Script Displayed | run script]] currently displayed in Notepad++
[[PHP PORTABLE IDE: PHP extensions | PHP extensions]]
|
This page shows how to enable PHP extensions in the CLI configuration and ensure that the correct file is being picked up.* Running CLI scripts , the PHP interpreter needs to know [[PHP PORTABLE IDE: PHP extensions#Update NppExec command script |what configuration file to use.]] also Also true when run via a command script.* Checking that correct configuration file is being picked up you . You can put a [[PHP PORTABLE IDE: PHP extensions#PHP configuration file - php_cli_ide.ini | dummy line]] in the configuration file to produce an error or use the [[PHP PORTABLE IDE: PHP extensions#PHP INFO | PHP info function]].
* How to enable PHP extensions using the [[PHP PORTABLE IDE: PHP extensions#Enabling extensions | WinBinder extension]] as an example.
* Generally when a file is double clicked you expect that file to be run with the correct application. Interestingly this can lead to some confusion , especially for PHP files see . See [[PHP PORTABLE IDE: PHP extensions#Double clicking PHP file problem | Double clicking PHP file problem.]]* Want to preserve file associations ; for example .php is associated with a PHP editor and you want to run that script on a server when double clicked use . Use a [[PHP PORTABLE IDE: PHP extensions#PHP CLI redirect script | redirection file]]!
|-valign="top"
|
[[PHP PORTABLE IDE: Run Menu | Run Menu]]
|
This page looks at automating functionality using the Notepad++ menu system.* After editing a PHP script , it is advisable to run a [[PHP PORTABLE IDE: Run Menu#PHP Syntax check | syntax check]]. This functionality is assigned to a menu item.* Similarly running a [[PHP PORTABLE IDE: Run Menu#Run PHP web page on server | page on a local web server]] is assigned to a [[PHP PORTABLE IDE: Run Menu#Edit Notepad++ file shortcuts.xml | menu item]]. This runs a [[PHP PORTABLE IDE: Run Menu#PHP CLI redirect script | PHP script]] that indirectly (via a browser) runs a script on a local server. A server may be configured to pass files with any extension , hence the PHP redirection makes no distinction.
|-valign="top"
|
* To run XDebug a separate [[PHP PORTABLE IDE: Notepad++ XDebug 1#PHP Configuration file | configuration file] specific to PHP CLI is required.
* Similarly [[PHP PORTABLE IDE: Notepad++ XDebug 1#Notepad++ DBGp client configuration | configuration of Notepad++’s client]] plugin is easy requiring only a few mouse clicks.
* Our IDE requires both console and debugging windows to be open , however there is an issue when these are docked . [[PHP PORTABLE IDE: Notepad++ XDebug 1#Docking Problem | solutionSolution]] is to undock them.
* Adding a [[PHP PORTABLE IDE: Notepad++ XDebug 1#New NppExec script | new command script]] to run PHP CLI debugging requires only minor changes to an existing script.
|-valign="top"
* [[PHP PORTABLE IDE: Notepad++ Debugging 1#Debugging overview | Debugging overview]] shows complete sequence for debugging CLI scripts.
* A powerful feature is the ability to [[PHP PORTABLE IDE: Notepad++ Debugging 1#Change Value of a variable | change a variable]] while debugging.
* Interested When interested in tracking a small number of variables then , add them as [[PHP PORTABLE IDE: Notepad++ Debugging 1#Watches | watches]].
* How to use [[PHP PORTABLE IDE: Notepad++ Debugging 1#Xdebug Break function | Xdebug Break function]] useful for initiating a break point in included pages.
* Notepad++'s integrated console window may be of limited use for your application . The alternative is to use an [[PHP PORTABLE IDE: Notepad++ Debugging 1#Alternative Console Window | external cmd window]] for debugging.
|
XDebug 2 covers setting up our IDE for running and debugging PHP web pages using the XDebug extension
* Again , the majority of material seems to be Linux orientated , hence a quick [[PHP PORTABLE IDE: Notepad++ XDebug 2#Overview | overview]] for Windows users
* This section covers [[PHP PORTABLE IDE: Notepad++ XDebug 2#XDebug download and install | downloading and installing]] XDebug on Uniform Server.
* Running XDebug on Uniform Server requires modifications to the [[PHP PORTABLE IDE: Notepad++ XDebug 2#PHP Configuration file | PHP configuration file]].
* Similarly [[PHP PORTABLE IDE: Notepad++ XDebug 2#Notepad++ DBGp client configuration | configuration of Notepad++’s client]] plugin is easy requiring only a few mouse clicks.
* Our IDE requires both console and debugging windows to be open however there is an issue when these are docked [[PHP PORTABLE IDE: Notepad++ XDebug 2#Docking Problem | solution]] is to undock them.
* At this stage you will have noticed duplication between pages XDebug 1 and XDebug 2 this . This is intentional ; see [[PHP PORTABLE IDE: Notepad++ XDebug 2#Important Commonality | Important Commonality]].
|-valign="top"
|
This page provides a recap of material already covered and provides an [[PHP PORTABLE IDE: Notepad++ Debugging 2#New redirection script | updated redirect script]].
* Recap example. Debuggining Debugging initiated useing using a browser and from Notepad++
* Add menu items to Context Menu
* Run Script On Server
|}
'''''[[#top | Top]]'''''
== Download and Install ==
After reading this design tutorial , why not download either the finished Portable IDE or Plugin.?
Download and Install details are provided on this page: [[Uniform Server PHP IDE: Introduction | Uniform Server PHP IDE]]
'''''[[#top | Top]]'''''
== Summary ==
First page introduces the core component [[PHP PORTABLE IDE: Notepad++ | '''Notepad++''']]
 
'''''[[#top | Top]]'''''
----

Navigation menu