Discussion forum Download Articles Non-technical

Support This Project

PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Its syntax draws upon C, Java, and Perl, and is easy to learn. The main goal of the language is to allow web developers to write dynamically generated WebPages quickly, but you can do much more with PHP.

PHP4Delphi  is a Visual Development Framework for creating custom PHP Extensions using Delphi. PHP extension, in the most basic of terms, is a set of instructions that is designed to add functionality to PHP.

PHP4Delphi also allows executing the PHP scripts within the Delphi program directly from file or memory. You can read and write global PHP variables and set the result value.

PHP4Delphi allows you to embed the PHP interpreter into your Delphi application so you can extend and customize the application without having to recompile it.

PHP4Delphi is organized into the following subprojects:

PHP scripting (using PHP in Delphi applications)
PHP4Delphi allows to execute the PHP scripts within the Delphi program directly without a WebServer.

PHP extensions development framework (using Delphi to extend PHP functionality)
Visual Development Framework gives possibility to create custom PHP Extensions using Delphi.

PHP4Applications (integrate PHP in any application)
Supports C, C++, Visual Basic, VBA, etc…

 PHP is freely available from

For more information on the PHP Group and the PHP project, please see


  •         Supports PHP 4 and PHP 5

  •         PHP API and ZEND API converted from C to Delphi

  •         psvPHP component written completely in Delphi

  •         phpLibrary component which allows to add new build-in  PHP functions to psvPHP component

  •         New visual PHP extension development framework to create PHP extensions using Delphi.

The creation of a PHP Extension DLL is similar to the development of any standard DLL. For this purpose it is necessary to load Delphi, in the menu File choose item New, then in a New Items dialog box choose an icon PHP Extension and to press the OK button.

PHP4Delphi provides a full design time environment for the development of PHP Extensions. A special Data Module PHPExtension is added to your new project; You can place any non-visual controls in it and work with them.

The main properties of PHPExtension module are:

  • Name: Contains the module name (for example, "File functions", "Socket functions", "Crypt", etc.). This name will show up in phpinfo(), in the section "Additional Modules." 
  • Version: The version of the module. You can use NO_VERSION_YET if you don't want to give the module a version number yet, but we really recommend that you add a version string here. Such a version string can look like this (in chronological order): "2.5-dev", "2.5RC1", "2.5" or "2.5pl3".
  • Functions: Contains all the functions that are to be made available externally, with the function's name as it should appear in PHP

TPHPFunction properties:

  • Name: Denotes the function name as seen in PHP (for example, fopen, mysql_connect, or, in our example, myfunction). 
  • Parameters: Contains the collection of function parameters.  Each parameter object in the collection represents an individual parameter. Use Items to access a particular parameter. Index indicates the specific parameter to access. Index identifies the parameter’s position in the collection of parameters, in the range 0 to Count - 1.