@@ -4,7 +4,7 @@ Interface for PHP to DB2 for z/OS, DB2 for LUW, DB2 for i.
4
4
5
5
## Pre-requisites
6
6
7
- The minimum PHP version supported by driver is PHP 7.3 and the latest version supported is PHP 8.1 .
7
+ The minimum PHP version supported by driver is PHP 7.3 and the latest version supported is PHP 8.2 .
8
8
9
9
## IBM i users
10
10
@@ -36,67 +36,77 @@ If not installed Download from the below link.
36
36
PHP should be installed in your system.
37
37
38
38
## How to install php pdo_ibm extension in Linux/Mac
39
- ```
40
- if IBM_DB_HOME and LD_LIBRARY_PATH environment variable not set then set them with installed CLIDRIVER.
41
- (say CLIDRIVER installed at "/home/user/clidriver")
42
39
40
+ If ` IBM_DB_HOME ` and ` LD_LIBRARY_PATH ` environment variables are not set, then set them with installed CLIDRIVER.
41
+ (say CLIDRIVER installed at ` /home/user/clidriver ` )
42
+
43
+ ``` shell
43
44
export IBM_DB_HOME=/home/user/clidriver
44
- export LD_LIBRARY_PATH=/home/user/clidriver/lib
45
+ export LD_LIBRARY_PATH=" ${IBM_DB_HOME} /lib"
46
+ ```
45
47
46
- 1) pecl install pdo_ibm
48
+ 1 . Install this extension:
49
+
50
+ ``` shell
51
+ pecl install pdo_ibm
52
+ ```
47
53
48
- 2) Open the php.ini file in an editor of your choice. Edit the extension entry in the
49
- php.ini file in the <local_php_directory>/php/lib directory to reference the PHP driver:
50
- extension=pdo_ibm.so
54
+ 2 . Open the ` php.ini ` file in an editor of your choice. Edit the extension entry in the
55
+ ` php.ini ` file in the ` <local_php_directory>/php/lib ` directory to reference the PHP driver:
56
+
57
+ ``` ini
58
+ extension =pdo_ibm.so
59
+ ```
51
60
52
- 3) Ensure that the PHP driver can access the libdb2.so CLI driver file by
53
- setting the LD_LIBRARY_PATH variable for Linux and UNIX operating systems
54
- other than the AIX® operating system. For AIX operating system, you must set LIBPATH variable.
61
+ 3 . Ensure that the PHP driver can access the ` libdb2.so ` CLI driver file by
62
+ setting the ` LD_LIBRARY_PATH ` variable for Linux and UNIX operating systems
63
+ other than the AIX® operating system. For AIX operating system, you must set ` LIBPATH ` variable.
55
64
56
- 4) Optional: If the PHP application that is connecting to an IBM database server is running ini
57
- the HTTP server environment, add the LD_LIBRARY_PATH variable in the httpd.conf file.
65
+ 4 . Optionally, if the PHP application that is connecting to an IBM database server is running in
66
+ the HTTP server environment, add the ` LD_LIBRARY_PATH ` variable in the ` httpd.conf ` file.
58
67
59
- ```
60
68
## Prebuilt binaries for Windows
61
69
62
70
1 . Add the ` CLIDRIVER\bin ` path to the ` PATH ` environment variable like so (for a batch file):
63
- ```
64
- set PATH=<CLIDRIVER installed path>\bin;%PATH%
65
- ```
71
+
72
+ ``` shell
73
+ set PATH=< CLIDRIVER installed path> \b in; %PATH%
74
+ ```
75
+
66
76
2 . Download the DLLs for PHP 7.x and 8.x from [ the ibmdb repository] ( https://github.com/ibmdb/php_ibm_db2 ) .
67
77
Select the build for the PHP that matches the version, architecture, and thread model.
68
78
69
79
3 . Open the ` php.ini ` file in an editor of your choice. Edit the extension entry in the
70
80
` php.ini ` file in the ` <local_php_directory>\php\lib ` directory to reference the driver:
71
- ````
72
- extension=php_pdo_ibm
73
- ````
81
+
82
+ ``` ini
83
+ extension =php_pdo_ibm
84
+ ```
74
85
75
86
## How to run sample program
76
87
77
- ### connect.php:-
88
+ Create a ` connect.php ` script with the following content:
78
89
79
- ```
90
+ ``` php
80
91
<?php
81
- $db = null;
82
- $dsn = "ibm:<DSN NAME> ";
83
- $user = "<USER >";
84
- $pass = "<PASSWORD >";
85
92
86
- $pdo = new PDO($dsn, $user, $pass) ;
87
- if ($pdo)
88
- print "Connection Successful.\n" ;
93
+ $dsn = 'ibm:< DSN NAME >' ;
94
+ $user = '< USER >';
95
+ $pass = '< PASSWORD >' ;
89
96
90
- ?>
97
+ $pdo = new \PDO($dsn, $user, $pass);
98
+ ```
91
99
100
+ To run the sample:
92
101
93
- To run the sample:- php connect.php
102
+ ```
103
+ php connect.php
94
104
```
95
105
96
106
## Contributing:
97
- ```
98
- See CONTRIBUTING.md
99
107
100
- The developer sign-off should include the reference to the DCO in defect remarks(example below):
108
+ The developer sign-off should include the reference to the DCO in defect remarks, like in this example:
109
+
110
+ ```
101
111
DCO 1.1 Signed-off-by: Random J Developer <random@developer.org>
102
112
```
0 commit comments