perevoznyk / php4delphi

PHP to Delphi integration
Apache License 2.0
19 stars 16 forks source link
                 PHP4Delphi library                       

PHP - Delphi interface and PHP extensions development framework

{ $Id: readme.txt,v 6.2 02/2006 delphi32 Exp $ }

PHP4Delphi is a Delphi interface to PHP for Delphi 5, 6, 7, Delphi 2005 and Delphi 2006.

PHP4Delphi consists of 3 big subprojects:

  1. PHP scripting (using php as a scripting language in Delphi applications) PHP4Delphi allows to execute the PHP scripts within the Delphi program using TpsvPHP component directly without a WebServer. TpsvPHP is not a component for
    server-side development. It is a scripting for applications (like VBA for Office). It is a PHP extension that enables you to write client-side GUI applications. One of the goals behind it was to prove that PHP is a capable general-purpose scripting language that is suited for more than just Web applications. It is intended for creating standalone GUI applications. If you want to use PHP within your application you can use Indy idHTTPServer component and idISAPIRunner + PHP4ISAPI or idCGIRunner + php.exe. You will have exactly the same results as using IIS or Apache. With php4Delphi you can use delphi forms instead of web-forms, pass parameters to script directly, without using GET and POST methods.

  2. PHP extensions development framework (using Delphi to extend PHP functionality) Visual Development Framework gives possibility to create 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.

  3. PHP4Applications (integrate PHP in any application) Supports C, C++, Visual Basic, VBA, C#, Delphi, Delphi .NET, Visual Basic .NET etc.

More detail information available in php4Delphi manual php4Delphi.pdf

This is a source-only release of php4Delphi. It includes designtime and runtime packages for Delphi 5 through Delphi 2006.

Warning:

PHP 4.3.5 gives some memory management troubles with php4delphi This problem is fixed in PHP 4.3.6

History:

6.2

6.1

6.0

5.5 fix 1

5.5

5.4

5.3

5.2

5.0.3

5.0.2

5.0.1

Before using php4Delphi library:

If you have no PHP installed, you have to download and install PHP separately. It is not included in the package. You can download the latest version of PHP from http://www.php.net/downloads.php

ZEND API documentation available at http://www.zend.com PHP API documentation available at http://www.php.net

You need to ensure that the dlls which php uses can be found. php4ts.dll is always used. If you are using any php extension dlls then you will need those as well. To make sure that the dlls can be found, you can either copy them to the system directory (e.g. winnt/system32 or windows/system).

Copy the file, php.ini-dist to your %WINDOWS% directory on Windows 95/98 or to your %SYSTEMROOT% directory under Windows NT, Windows 2000 or Windows XP and rename it to php.ini. Your %WINDOWS% or %SYSTEMROOT% directory is typically: c:\windows for Windows 95/98 c:\winnt or c:\winnt40 for NT/2000/XP servers

How to install php4Delphi library:

  1. Delphi 5.x:

Uninstall previous installed version of php4Delphi Library from Delphi 5 IDE. Remove previously compiled php4Delphi packages from your hard disk.

Select PHP version you are going to use. php4Delphi supports PHP 4.x and PHP 5.x, but not at the same time. You have to compile php4Delphi for selected target version of PHP.

Open PHP.INC file. If you are using PHP5: a) Comment (remove) PHP4 directive {$DEFINE PHP4} b) Uncomment (remove dot) directive {$DEFINE PHP5} c) Save PHP.INC file

If you are using PHP4: a) Comment (remove) PHP5 directive {$DEFINE PHP5} b) Uncomment (remove dot) directive {$DEFINE PHP4} c) If you are using PHP version 4.2.x...4.3.0 add {$DEFINE PHP430} and remove {$DEFINE PHP433} If you are using PHP version 4.3.3...4.3.x add {$DEFINE PHP433} and remove {$DEFINE PHP430} d) Save PHP.INC file

Use "File\Open..." menu item of Delphi IDE to open php4Delphi runtime package php4DelphiR5.dpk. In "Package..." window click "Compile" button to compile packages php4DelphiR5.dpk. Put compiled BPL file into directory that is accessible through the search PATH (i.e. DOS "PATH" environment variable; for example, in the Windows\System directory).

After compiling php4Delphi run-time package you must install design-time package into the IDE.

Use "File\Open..." menu item to open design-time package php4DelphiD5.dpk. In "Package..." window click "Compile" button to compile the package and then click "Install" button to register php4Delphi Library components on the component palette.

  1. Delphi 6.x:

Uninstall previous installed version of php4Delphi Library from Delphi 6 IDE. Remove previously compiled php4Delphi packages from your hard disk.

Select PHP version you are going to use. php4Delphi supports PHP 4.x and PHP 5.x, but not at the same time. You have to compile php4Delphi for selected target version of PHP.

Open PHP.INC file. If you are using PHP5: a) Comment (remove) PHP4 directive {$DEFINE PHP4} b) Uncomment (remove dot) directive {$DEFINE PHP5} c) Save PHP.INC file

If you are using PHP4: a) Comment (remove) PHP5 directive {$DEFINE PHP5} b) Uncomment (remove dot) directive {$DEFINE PHP4} c) If you are using PHP version 4.2.x...4.3.0 add {$DEFINE PHP430} and remove {$DEFINE PHP433} If you are using PHP version 4.3.3...4.3.x add {$DEFINE PHP433} and remove {$DEFINE PHP430} d) Save PHP.INC file

Use "File\Open..." menu item of Delphi IDE to open php4Delphi runtime package php4DelphiR6.dpk. In "Package..." window click "Compile" button to compile packages php4DelphiR6. Put compiled BPL file into directory that is accessible through the search PATH (i.e. DOS "PATH" environment variable; for example, in the Windows\System directory).

After compiling php4Delphi run-time package you must install design-time package into the IDE.

Use "File\Open..." menu item to open design-time package php4DelphiD6.dpk. In "Package..." window click "Compile" button to compile the package and then click "Install" button to register php4Delphi Library components on the component palette.

  1. Delphi 7.x:

Uninstall previous installed version of php4Delphi Library from Delphi 7 IDE. Remove previously compiled php4Delphi packages from your hard disk.

Select PHP version you are going to use. php4Delphi supports PHP 4.x and PHP 5.x, but not at the same time. You have to compile php4Delphi for selected target version of PHP.

Open PHP.INC file. If you are using PHP5: a) Comment (remove) PHP4 directive {$DEFINE PHP4} b) Uncomment (remove dot) directive {$DEFINE PHP5} c) Save PHP.INC file

If you are using PHP4: a) Comment (remove) PHP5 directive {$DEFINE PHP5} b) Uncomment (remove dot) directive {$DEFINE PHP4} c) If you are using PHP version 4.2.x...4.3.0 add {$DEFINE PHP430} and remove {$DEFINE PHP433} If you are using PHP version 4.3.3...4.3.x add {$DEFINE PHP433} and remove {$DEFINE PHP430} d) Save PHP.INC file

Use "File\Open..." menu item of Delphi IDE to open php4Delphi runtime package php4DelphiR7.dpk. In "Package..." window click "Compile" button to compile packages php4DelphiR7.dpk. Put compiled BPL file into directory that is accessible through the search PATH (i.e. DOS "PATH" environment variable; for example, in the Windows\System directory).

After compiling php4Delphi run-time package you must install design-time package into the IDE.

Use "File\Open..." menu item to open design-time package php4DelphiD7.dpk In "Package..." window click "Compile" button to compile the package and then click "Install" button to register php4Delphi Library components on the component palette.

  1. Delphi 2005:

Uninstall previous installed version of php4Delphi Library from Delphi 2005 IDE. Remove previously compiled php4Delphi packages from your hard disk.

Select PHP version you are going to use. php4Delphi supports PHP 4.x and PHP 5.x, but not at the same time. You have to compile php4Delphi for selected target version of PHP.

Open PHP.INC file. If you are using PHP5: a) Comment (remove) PHP4 directive {$DEFINE PHP4} b) Uncomment (remove dot) directive {$DEFINE PHP5} c) Save PHP.INC file

If you are using PHP4: a) Comment (remove) PHP5 directive {$DEFINE PHP5} b) Uncomment (remove dot) directive {$DEFINE PHP4} c) If you are using PHP version 4.2.x...4.3.0 add {$DEFINE PHP430} and remove {$DEFINE PHP433} If you are using PHP version 4.3.3...4.3.x add {$DEFINE PHP433} and remove {$DEFINE PHP430} d) Save PHP.INC file

Use "File\Open..." menu item of Delphi IDE to open php4Delphi runtime package php4DelphiR2005.dpk. In "Package..." window click "Compile" button to compile packages php4DelphiR2005.dpk. Put compiled BPL file into directory that is accessible through the search PATH (i.e. DOS "PATH" environment variable; for example, in the Windows\System directory).

After compiling php4Delphi run-time package you must install design-time package into the IDE.

Use "File\Open..." menu item to open design-time package php4DelphiD2005.dpk In "Package..." window click "Compile" button to compile the package and then click "Install" button to register php4Delphi Library components on the component palette.

  1. Delphi 2006:

Uninstall previous installed version of php4Delphi Library from Delphi 2006 IDE. Remove previously compiled php4Delphi packages from your hard disk.

Select PHP version you are going to use. php4Delphi supports PHP 4.x and PHP 5.x, but not at the same time. You have to compile php4Delphi for selected target version of PHP.

Open PHP.INC file. If you are using PHP5: a) Comment (remove) PHP4 directive {$DEFINE PHP4} b) Uncomment (remove dot) directive {$DEFINE PHP5} c) Save PHP.INC file

If you are using PHP4: a) Comment (remove) PHP5 directive {$DEFINE PHP5} b) Uncomment (remove dot) directive {$DEFINE PHP4} c) If you are using PHP version 4.2.x...4.3.0 add {$DEFINE PHP430} and remove {$DEFINE PHP433} If you are using PHP version 4.3.3...4.3.x add {$DEFINE PHP433} and remove {$DEFINE PHP430} d) Save PHP.INC file

Use "File\Open..." menu item of Delphi IDE to open php4Delphi runtime package php4DelphiR2006.dpk. In "Package..." window click "Compile" button to compile packages php4DelphiR2006.dpk. Put compiled BPL file into directory that is accessible through the search PATH (i.e. DOS "PATH" environment variable; for example, in the Windows\System directory).

After compiling php4Delphi run-time package you must install design-time package into the IDE.

Use "File\Open..." menu item to open design-time package php4DelphiD2006.dpk In "Package..." window click "Compile" button to compile the package and then click "Install" button to register php4Delphi Library components on the component palette.

Since this is a freeware you are strongly encouraged to look at the source code and improve on the components if you want to. Of course I would appreciate it if you would send me back the changes and bug fixes you have made.

For more information on the PHP Group and the PHP project, please see http://www.php.net.

Author:
Serhiy Perevoznyk
Belgium