Skip to content

Commit a9b2ff1

Browse files
authored
Merge pull request #17 from phansys/readme
Update `README.md`
2 parents a9af03a + eb2f131 commit a9b2ff1

File tree

1 file changed

+45
-35
lines changed

1 file changed

+45
-35
lines changed

README.md

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Interface for PHP to DB2 for z/OS, DB2 for LUW, DB2 for i.
44

55
## Pre-requisites
66

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.
88

99
## IBM i users
1010

@@ -36,67 +36,77 @@ If not installed Download from the below link.
3636
PHP should be installed in your system.
3737

3838
## 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")
4239

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
4344
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+
```
4547

46-
1) pecl install pdo_ibm
48+
1. Install this extension:
49+
50+
```shell
51+
pecl install pdo_ibm
52+
```
4753
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+
```
5160
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.
5564

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.
5867

59-
```
6068
## Prebuilt binaries for Windows
6169

6270
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>\bin;%PATH%
74+
```
75+
6676
2. Download the DLLs for PHP 7.x and 8.x from [the ibmdb repository](https://github.com/ibmdb/php_ibm_db2).
6777
Select the build for the PHP that matches the version, architecture, and thread model.
6878

6979
3. Open the `php.ini` file in an editor of your choice. Edit the extension entry in the
7080
`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+
```
7485

7586
## How to run sample program
7687

77-
### connect.php:-
88+
Create a `connect.php` script with the following content:
7889

79-
```
90+
```php
8091
<?php
81-
$db = null;
82-
$dsn = "ibm:<DSN NAME>";
83-
$user = "<USER>";
84-
$pass = "<PASSWORD>";
8592

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>';
8996

90-
?>
97+
$pdo = new \PDO($dsn, $user, $pass);
98+
```
9199

100+
To run the sample:
92101

93-
To run the sample:- php connect.php
102+
```
103+
php connect.php
94104
```
95105

96106
## Contributing:
97-
```
98-
See CONTRIBUTING.md
99107

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+
```
101111
DCO 1.1 Signed-off-by: Random J Developer <random@developer.org>
102112
```

0 commit comments

Comments
 (0)