Free PHP Editor Install And Settings

Devphp has a simple and clear interface, constituted of three zones : the edit window where you type your code, the side panel which gives informations and access to parts of your project (files, functions…) and the messages zone which gives information on what is presently happening. Each zone has tabs to select the required information. Since Devphp is intended to be used by developers, users are supposed to have already a good knowledge of editors. For this reason the basic features will not be mentioned here. Fast and powerful, it is easy to use and has a lot of cool features : class browser, scripts preview, integration with PHP parsers,Dev-PHP is a very well-featured integrated development environment (IDE) for PHP. You’ll be able to create scripts and applications using the PHP scripting language and the PHP-GTK library (both included in the “PHP Package”). Dev-PHP-usb slips even into your pocket.

Lists directories and files inside your project (subdirectories of the base directory you provided). A double clic on a file will open it in the editor.
The Classes tab

Gives the tree structure of globals, defines, includes & requires, functions, classes, constants, members and methods from the file opened in the editor.
A double-click on an item

will show its location in the editor or,
in case of include / include_once / require / require_once, will open the corresponding file in editor.

There is a small bug in the Synedit component used by Dev-PHP which cannot be corrected because SynEdit is no longer maintained. If a string (with single or double quotes) includes line ends, they are not counted in the total of lines and this introduces a discrepancy in the positionning of the highlighted line when you double click a function in the list, for all subsequent functions.

Note that php 5.3 has introduced a variant : if the identifier is surronded by single quotes, the string will not be evaluated :

$variable = "Hello world!";
$test1 = <<<ID
This is the well known example :
$variable
ID
$test2 = <<<'ID'
This is the well known example :
$variable
ID
echo "$test1 \n\n$test2";

will diplay :

This is the well known example :
Hello world!
This is the well known example :
$variable

The BOTS tab

Small useful pieces of code. You can add your own code, either code that you use often or code that you don’t use frequently and each time you need it you have to go through all the documentation to find how this stupid thing can be done. You can also access online code repositories from here.
The Help tab
The Editor Panel
The Editor tab

A full featured code editor with syntax highlighting
The Internal Preview tab

This is a small internal web server which allows you to test your code without any external components (don’t need a running Apache server). It is very convenient if you are doing casual work t may not be visible if you are working on a php-gtk project.
The External Preview tab

To test your code in real life on an external web server, normally the server on which your code will be deployed. So you can see how your code will exactly appear when published on your web site. Configured in Options / Project / Web Server.
The Documentation tab

Used by the Help tab of the side panel to show documentation . Must be configured in Options / Extra.
The Browser tab

A small web browser. Used to display this Wiki, if you choose Help / Dev-PHP Documentation in the menu, or to access Dev-PHP Website, or for any purpose.
The Print Preview tab

Print Preview of your code
The Messages panel
The Search Results tab

The result of search in file(s) or directory will be displayed here. A clic on a line shows the passage in the editor
The Evaluation tab

A major feature in Devphp : When in debug mode, you will see here the values of the variables in your program. Either all local variables (with the button “context” or variables you choose to track. See Debugging for details.
The Debugger Log tab

Messages from the debugger are displayed here
The Backtrace tab
The ToDo List tab

ToDo Lists helps you remember all those small improvements or non critical bugs we often leave in our code because we are in a hurry to do more important things, and which can remain unfinished because they are forgotten. In such a case, just add a ToDo entry, and you will retrieve easily later what has to be finished.

Click here for details.
The Syntax tab

When you ask for Syntax Check (CTRL + F10) then the result is displayed in this tab. If nothing appears there, don’t worry your code is OK ! If syntax errors are encountered, then the tab turns red and the line and the php message are displayed here.

Double click a line to show the error in the Editor window.
The Menu bar

File
nothing special here
Edit
Change selection : toggles between normal selection and rectangle selection
Optimize/Compress code : allows some global operations on the code (delete tabs and line feeds, turn to lower or uppercase)
Search
Powerful search options are presented here. See details here : Search
View
Should be obvious. Note the customize toolbars option which allows to change the four toolbars content.
Format
The first four entries define the type of line end
The four following entries define the encoding of the text
With BOM : if checked, will add a small invisible code in the beginning of the file which helps other editors to recognize the file encoding. Suppose your file is encoded in Utf-8 format, if the BOM is not present and you open it in notepad, you will see all the utf-8 codes instead of the normal characters. If the BOM is present, the file opens normally.

Search PHP documentation : This is a contextual search : it will search the PHP documentation (povided it is correctly configured in “Options / Extra”) for the word which is under the cursor. To browse the full documentation, use the “Help” tab of the Side Panel.
Dev-PHP Documentation : will open this Wiki in the “Browser” tab of the Editor Panel

The Toolbars
Colors and appearance

You can move with the mouse almost any part of the interface. Here is a nonsense example which shows that elements can be placed in a different way :

Install PHP-GTK2

Connect to http://devphp.sourceforge.net/
Download the huge version of PiGii and install it. This installer will
Install and configure a PHP 5.2 with the mostly used extensions so you don’t have to worry about php.ini to have your MySQL (or other database) working. The main graphic extensions are also included. This should be sufficent for 90% of PHP applications.
Install and configure the Php-gtk2 extension
Install and configure the Xdebug extension.
Install Glade 3.4.3. It will run directly if you have kept the gtk install option checked. If you have already a GTK+ installation somewhere, it could be possible to run Glade with it, but you will probably have some troubles with missing dll. It is more simple to install the full package and your Glade 3 will run out of the box.

All in one !!!

You can generally keep the default settings, but you are free to change them, provided you know what they mean.
Install Dev-PHP

If you are installing for the first time, then get the “IDE + Installer” otherwise there will be missing files. If you are updating, you can download only the exe file, overwrite the old one and you are done.
Install Dev-PHP in the directory you want.
When you run Dev-PHP for the first time, you will get a Welcome message indicating that Dev-PHP is creating its configuration files. These files are stored in “Documents and Settings\\Application Data\DevPHP.
Then you are invited to select a folder for your first project.
The program opens with and empty window.

Configure Dev-PHP

Copy in the directory you have choosed a php file and open it in the editor, or create a new one.

Open the menu Options / General options… / Project : there you will indicate the path to your php.exe file. There are two situations you must clearly distinguish :

if you want to test a standalone script (typically a php-gtk script), you must choose php.exe and NOT php-cgi.exe which is intended for web based scripts. So, in this tab you will choose the php.exe of your php-gtk2 directory, and you will choose the php-cli.ini file in the second line of the dialog. Please be careful to select the php-cli.ini, this is the ini file used by the php.exe engine of your php-gtk2 installation.
if you want to test a web-based php script, you must choose php-cgi.exe in your php directory (either the php directory installed by PiGii of another of your choice). Choose also the php.ini file you need. If the file is “php.ini”, you don’t need to indicate it since it is the default file.

Click OK to close the dialog.

Configure Dev-PHP for Xdebug

If you have followed the steps above, Xdebug has been automatically configured when you have clicked OK on step 3) c), because the necessary data was preinstalled by PiGii in the php-cli.ini file. To verify this, open again the Options / General options dialog and choose the Debugger tab. You should see the path to the debugger in the first field :
If you had not followed the above steps (if your php-gtk directory was already installed and you didn’t use PiGii, then you must indicate here the path to the Xdebug dll and choose a 5.2 nts version (nts, this is very important, the ts version will not run with php-gtk 2.0.1).

Test your program

Close Dev-PHP and reopen it so that the configuration is loaded.
Open your program, and type F5 (or open Run / Run PHP-GTK). Your program should run.

Test the debugger

Now the Exciting part : First show the Debug toolbar if it is not yet active (Menu View / Debug Toolbar). It is presently greyed.
Type CTRL + F5, or open Run / PHP-GTK + Xdebug. The Debug toolbar is now colored and appear like this :

Click on the Step into icon (or type F8). A green triangle appears on the left of the first line of your program.
Now have fun ! This means Dev-PHP is now ready to debug your script. See the documentation to learn all the features of the debugger.

Complementary information

For detailed information about the options configured above and the php-cli.ini file, see the documentation.