|
1 |
| -PL/php Installation Procedure |
| 1 | +PL/php is a procedural language add-on for PostgreSQL. |
2 | 2 |
|
3 |
| -You can always get the recent version of this document at: |
4 |
| -https://public.commandprompt.com/projects/plphp/wiki/InstallDocs |
| 3 | +It allows you to create PHP functions that are stored inside a PostgreSQL |
| 4 | +database server. They can then be used as stored procedures. They have |
| 5 | +many of the functionalities of a standard PostgreSQL function, and you |
| 6 | +can use them to write triggers, set-returning functions, and plain functions |
| 7 | +that would just be too complex or cumbersome to write in PL/pgSQL. |
5 | 8 |
|
6 |
| -Note that building against Apache's mod_php (libphp.so) is no longer supported. |
7 |
| - |
8 |
| -The current PL/php release utilizes the GNU build system using |
9 |
| -autoconf/configure to detect system-specific features. |
10 |
| -If the configure program is not present (perhaps because you downloaded from |
11 |
| -Subversion), you need to run |
12 |
| - |
13 |
| - autoconf |
14 |
| - |
15 |
| -Use configure --help to list all the available options. |
16 |
| - |
17 |
| -In some cases configure may fail to locate your PostgreSQL or PHP installation. |
18 |
| -You can use the following configure options to correct this: |
19 |
| - |
20 |
| ---with-php=PHPDIR:: |
21 |
| - specify a path to the PHP installation (configure searches for |
22 |
| - php-config in PHPDIR or PHPDIR/bin) |
23 |
| - --with-postgres=PGDIR:: |
24 |
| - specify a path to the PostgreSQL installation (configure looks for |
25 |
| - pg_config in PGDIR or PGDIR/bin). |
26 |
| -Note 1: you need at least PostgreSQL 8.1 and PHP 5. |
27 |
| - |
28 |
| -Note 2: you need GNU make to build PL/php. On systems where GNU make is not the |
29 |
| -default make program (e.g. FreeBSD) you can usually invoke the GNU version with |
30 |
| -gmake. |
31 |
| - |
32 |
| -Building a suitable PHP installation |
33 |
| -To build PL/php you need the PHP "embed" library (libphp5.so). To build and |
34 |
| -install a shared PHP embed library, unpack the PHP tarball, change dir to the |
35 |
| -PHP source dir and configure with the appropriate options: |
36 |
| - |
37 |
| - tar xfj php-5.2.6.tar.bz2 |
38 |
| - cd php-5.2.6 |
39 |
| - configure --enable-embed --prefix=/usr/local [--other-options] |
40 |
| - make install |
41 |
| -You can, of course, use any other directory instead of /usr/local, but then you |
42 |
| -need to make sure that the PostgreSQL server will be able to find the libraries |
43 |
| -in there if you use something else (either by using LD_LIBRARY_PATH or by |
44 |
| -adding it to /etc/ld.so.conf). |
45 |
| - |
46 |
| -If it doesn't work |
47 |
| - |
48 |
| -Please open a ticket here if you see a problem, with all the details you manage |
49 |
| -to put into it, so that we can find out how to solve it. |
50 |
| - https://public.commandprompt.com/projects/plphp |
0 commit comments