-
Notifications
You must be signed in to change notification settings - Fork 4
/
INSTALL_LINUX.txt
140 lines (93 loc) · 5.35 KB
/
INSTALL_LINUX.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
NuoDB PHP PDO Driver Linux install instructions
================================================
This file contains instructions for installing the NuoDB PHP PDO Driver
on Linux operating systems.
1.0 PHP Information
=====================
On Linux, there are four pieces of information you need to obtain from your PHP installation:
1) PHP Version number
2) PHP Thread Safety model (TS or NTS)
3) Location of PHP Configuration File (php.ini)
4) Location of PHP extension directory (extension_dir)
PHP can be used from the command line or within a web server.
1.1 Using PHP from the command line
------------------------------------
If you are using PHP from the command line, you can run the following commands to obtain that information.
$ php -i | grep "PHP Version"
$ php -i | grep "Thread Safety"
$ php -i | grep "Configuration File"
$ php -i | grep "extension_dir"
1.2 Using PHP from a web server
--------------------------------
If you are running PHP from a web server, create a phpinfo.php that contains the following:
<?php
phpinfo();
?>
Copy that phpinfo.php file to your web server and browse it to obtain the above PHP information.
2.0 NuoDB PHP PDO Driver for Linux
===================================
The NuoDB PHP PDO Driver is located in your NuoDB installation directory. You must manually install and configure the NuoDB PHP PDO Driver. There are two versions of the NuoDB PHP PDO Driver that is provided for Linux. In the directory /opt/nuodb/drivers/php_pdo you will find the following files:
INSTALL_LINUX.txt <-- this file
php-5.3.NTS <-- contains NuoDB PHP PDO Driver for PHP version 5.3, Non Thread Safe
php-5.4.NTS <-- contains NuoDB PHP PDO Driver for PHP version 5.4, Non Thread Safe
sample <-- contains an example program.
Note: If your PHP information does not match the above PHP Version number and Thread Safety, you can obtain source code for the NuoDB PHP PDO Driver on GitHub which you can use to build your own NuoDB PHP PDO Driver that matches your particular version/thread safety of your PHP install.
2.1 NuoDB PHP PDO Driver shared library (pdo_nuodb.so)
------------------------------------------------------
The NuoDB PHP PDO Driver is a shared library that is dynamically loaded by the PHP executable. This shared library conforms to the PHP PDO extension API and must be copied to your PHP extension directory. The shared library name is 'pdo_nuodb.so' on Linux. You must copy the shared library that matches your PHP version information to your PHP Extension Directory. For example, Ubuntu 12.04 comes with PHP Version 5.3.10 NTS and uses '/usr/lib/php5/20090626' for the PHP Extension Directory:
$ sudo cp /opt/nuodb/drivers/php_pdo/php-5.3.NTS/pdo_nuodb.so /usr/lib/php5/20090626
As another example, the Amazon Linux AMI, which is based on CentOS, uses '/usr/lib64/php/modules/' for the PHP Extension Directory.
2.2 libNuoRemote.so
--------------------
The NuoDB PHP PDO Driver shared library 'pdo_nuodb.so' is dependent on the 'libNuoRemote.so' shared library, which is located in the '/opt/nuodb/lib64' directory. If you installed NuoDB using the RPM or Debian installers, then '/opt/nuodb/lib64' is already added to your system's dynamic load library path. If you installed NuoDB from a .tar file, then you must manually add '/opt/nuodb/lib64' to your dynamic load library path.
2.3 Enable the NuoDB PHP PDO Driver
------------------------------------
After you have copied the NuoDB PHP PDO driver to the PHP extension directory, you need to modify your PHP configuration to automatically load the NuoDB PHP PDO driver when PHP runs. You can do this by adding the following line to the end of your pdo.ini file in your PHP configuration directory (commonly '/etc/php.d' on Linux).
extension=pdo_nuodb.so
3.0 Verifying the NuoDB PHP PDO Driver
======================================
After you have modified your PHP configuration, you can check if the NuoDB PHP PDO driver is loading correctly.
3.1 If you are using the PHP command line
------------------------------------------
$ php -i | grep PDO
Which should show 'nuodb' in the list of PDO drivers and should also show "PDO Driver for NuoDB => enabled".
3.2 If you are using PHP from a web server
------------------------------------------
Rerun the phpinfo.php script in your web browser. The PDO section, PDO Drivers should show 'nuodb'.
4.0 Running the NuoDB PHP PDO Driver example
==============================================
If you have run the NuoDB quick start (run-quickstart), then you can use the example.php script to display information from the example "hockey" database. Example execution output:
$ php /opt/nuodb/drivers/php_pdo/sample/example.php
Array
(
[ID] => 2
[0] => 2
[NUMBER] => 11
[1] => 11
[NAME] => GREGORY CAMPBELL
[2] => GREGORY CAMPBELL
[POSITION] => Forward
[3] => Forward
[TEAM] => Bruins
[4] => Bruins
)
Array
(
[ID] => 25
[0] => 25
[NUMBER] => 1
[1] => 1
[NAME] => MAX SUMMIT
[2] => MAX SUMMIT
[POSITION] => Fan
[3] => Fan
[TEAM] => Bruins
[4] => Bruins
)
done
5.0 NuoDB PHP PDO Driver logging
================================
When you are developing an application, it can be useful to have the NuoDB PHP PDO driver log its actions. You can enable a NuoDB PHP PDO Driver logfile by adding the following to your PHP Configuration (php.ini):
[pdo_nuodb]
pdo_nuodb.enable_log=1
pdo_nuodb.logfile_path=/tmp/nuodb_pdo.log