-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild-guide.html
741 lines (534 loc) · 34.1 KB
/
build-guide.html
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
.s1 {font-family: verdana, arial, sans-serif;}
.s2 {font-family: "Times New Roman", serif;}
.s3 {font-family: Consolas, "Courire New";}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>CUBRID 10.x PHP Library Build Guide</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#a00000" alink="#0000ff">
<h1>CUBRID 10.x PHP Library Build Guide</h1>
<h4><pre class = "s1">Open Source PHP Library for CUBRID Database
(http://sourceforge.net/projects/cubridinterface)</pre></h4>
<hr>
<ul class="menu">
<li><a accesskey="1" href="#Introduction">1. Introduction</a>
<li><a accesskey="2" href="#Building on Linux">2. Building on Linux</a>
<li><a accesskey="3" href="#Configuring the Environment for Linux">2.1 Configuring the Environment</a>
<li><a accesskey="4" href="#Compile PHP Library with PHP source code">2.2 Compile PHP Library with PHP source code</a>
<li><a accesskey="5" href="#Compile PHP Library for CUBRID individually">2.3 Compile PHP Library for CUBRID individually</a>
<li><a accesskey="6" href="#Test CUBRID PHP Library Installation">2.4 Test CUBRID PHP Library Installation</a>
<li><a accesskey="7" href="#Building on Windows x86">3. Building on Windows x86</a>
<li><a accesskey="8" href="#Compile CUBRID PHP Library with VC9 for PHP 5.4.x">3.1 Compile CUBRID PHP Library with VC9 for PHP 5.4.x</a>
<li><a accesskey="9" href="#Configuring the Environment for VC9">3.1.1 Configuring the Environment</a>
<li><a accesskey="10" href="#Build VC9 Library for PHP 5.4.x">3.1.2 Build VC9 Library for PHP 5.4.x</a>
<li><a accesskey="11" href="#Compile CUBRID PHP Library with VC11 for PHP 5.6.x">3.2 Compile CUBRID PHP Library with VC11 for PHP 5.6.x</a>
<li><a accesskey="12" href="#Configuring the Environment for VC11">3.2.1 Configuring the Environment</a>
<li><a accesskey="13" href="#Build VC11 Library for PHP 5.6.x">3.2.2 Build VC11 Library for PHP 5.6.x</a>
<li><a accesskey="14" href="#Compile CUBRID PHP Library with VC14 for PHP 7.1.x">3.3 Compile CUBRID PHP Library with VC14 for PHP 7.1.x</a>
<li><a accesskey="15" href="#Configuring the Environment for VC14">3.3.1 Configuring the Environment</a>
<li><a accesskey="16" href="#Build VC14 Library for PHP 7.1.x">3.3.2 Build VC14 Library for PHP 7.1.x</a>
<li><a accesskey="17" href="#Building on Windows x64">4. Building on Windows x64</a>
<li><a accesskey="17" href="#PHP 5.4.x">4.1 PHP 5.4.x</a>
<li><a accesskey="18" href="#Configuring the Environment for VC9 x64">4.1.1 Configuring the Environment</a>
<li><a accesskey="19" href="#Build x64 VC9 Library for PHP 5.4.x">4.1.2 Build x64 VC9 Library for PHP 5.4.x</a>
<li><a accesskey="20" href="#PHP 5.6.x">4.2 PHP 5.6.x</a>
<li><a accesskey="21" href="#Configuring the Environment for VC11 x64">4.2.1 Configuring the Environment</a>
<li><a accesskey="22" href="#Build x64 VC11 Library for PHP 5.6.x">4.2.2 Build x64 VC11 Library for PHP 5.6.x</a>
<li><a accesskey="23" href="#PHP 7.1.x">4.3 PHP 7.1.x</a>
<li><a accesskey="24" href="#Configuring the Environment for VC14 x64">4.3.1 Configuring the Environment</a>
<li><a accesskey="25" href="#Build x64 VC14 Library for PHP 7.1.x">4.3.2 Build x64 VC14 Library for PHP 7.1.x</a>
</ul>
<a name="Introduction"></a>
<h2>1. Introduction</h2>
<pre class = "s1">
This manual mainly tells you how to build CUBRID 10.x PHP Library with PHP on Linux and Windows.
The PHP driver of CUBRID supports the following PHP versions.
- PHP 5.4.x
- PHP 5.6.x
- PHP 7.1.x
</pre>
<a name="Building on Linux"></a>
<h2>2. Building on Linux</h2>
<pre class = "s1">
In this section, we will introduce two ways of building PHP Library for CUBRID on Linux:
1. Compile CUBRID PHP Library together with original PHP source code;
2. Compile CUBRID PHP Library individually.
</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
<b>Building CUBRID PHP Library on 64bit Linux</b>
In this section, we assume that the Linux system is 32bit. If you build CUBRID PHP Library on
64bit Linux, remember to install 64bit CUBRID 10.x
</pre></td></tr></table>
<a name="Configuring the Environment for Linux"></a>
<h3>2.1 Configuring the Environment</h3>
<li>CUBRID 10.x:</li>
<pre class = "s1">Install CUBRID 10.x, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your
system;</pre>
<li>PHP source code:</li>
<pre class = "s1">Download PHP source code (PHP 5.4.x, 5.6.x, or 7.1.x) from PHP.net. In this document, we use PHP 5.4.x, PHP 5.6.x, and 7.1.x.</pre>
<li>Apache2</li>
<pre class = "s1">We can use apache2 to test PHP.</pre>
<a name="Compile PHP Library with PHP source code"></a>
<h3>2.2 Compile PHP Library with PHP source code</h3>
<pre class = "s1"> 1. Extract PHP source code, and create directory cubrid under dir ext:</pre>
<pre class = "s3">
$> tar zxvf php-<version>.tar.gz (or tar jxvf php-<version>tar.bz2)
$> cd php-<version>/ext
ext> mkdir cubrid
</pre>
<pre class = "s1"> 2. Put the following files in CUBRID PHP Library into directory cubrid-php:</pre>
<pre class = "s3">
cubrid-php> php_cubrid.c php_cubrid.h php_cubrid7.c php_cubrid7.h php_cubrid_version.h config.m4
</pre>
<pre class = "s1"> 3. Go to the root directory of PHP source code and update the configuration file:</pre>
<pre class = "s3">
php-root> ./buildconf --force </pre>
<table border="0" bgcolor="silver" cellpadding="5"> <tr><td><pre class = "s1">
<b>Note:</b> When developing a PHP extension, it is strongly recommended that autoconf version 2.13 or later
be installed, despite the newer releases which are available. Version 2.13 is recognized as a common
denominator of autoconf availability, usability, and user base. Using later versions will sometimes
produce cosmetic differences from the expected output of configure.
You can set environment PHP_AUTOCONF to path of autconf-2.13 and set PHP_AUTOHEADER to
path of autoheader-2.13.
</pre></td></tr></table>
<pre class = "s1"> 4. Configure the project. Before you run configure, we strongly recommend that you run "./configure -h"
to check the configure options. An example may be like this (we assume that apache2 has been installed in
/usr/local): </pre>
<pre class = "s3">
php-root>./configure --prefix=/usr/local/php -with-cubrid=shared \
--with-apxs2=/usr/local/apache2/bin/apxs</pre>
<table border="0" bgcolor="silver" cellpadding="2">
<tr>
<td><pre class = "s1"> --with-cubrid=shared </pre></td>
<td><pre class = "s1"> Include CUBRID support </pre></td>
</tr>
<tr>
<td><pre class = "s1"> --with-apxs2=FILE </pre></td>
<td><pre class = "s1"> Build shared Apache 2.0 Handler module. FILE is the optional pathname to the Apache apxs tool apxs </pre></td>
</tr>
</table>
<pre class = "s1"> 5. Build and install the package. If it was successfully compiled, the cubrid.so file will be created in the /modules directory:</pre>
<pre class = "s3">
php-root> make; make install
</pre>
<pre class = "s1"> 6. Copy php.ini-xxx (In PHP, they are php.ini-development
and php.ini-production; choose what you need) file to directory /usr/local/php/lib, and rename it to php.ini.</pre>
<pre class = "s3">
php-root> cp php.ini-production /usr/local/php/lib/php.ini
</pre>
<pre class = "s1"> 7. In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable. For example:</pre>
<pre class = "s3">
extension_dir = "/usr/local/php/lib/php/extension/no-debug-zts-xxx"
extension = cubrid.so
</pre>
<a name="Compile PHP Library for CUBRID individually"></a>
<h3>2.3 Compile PHP Library for CUBRID individually</h3>
<pre class = "s1"> 1. Download PHP Library, extract it and enter the directory:</pre>
<pre class = "s3">
$> tar zxvf CUBRID-PHP-<version>.src.tar.gz
$> cd cubrid-php-<version>
</pre>
<pre class = "s1"> 2. Run phpize:</pre>
<pre class = "s3">
cubrid-php> /usr/bin/phpize
</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
<b>What is phpize? Where can I get it?</b>
phpize is a shell script to prepare PHP extension for compiling. Typically, when you install PHP, phpize will
be automatically installed. If it is not installed on your system, the process of getting it is as follows:
1. Download PHP source code, and make sure its version is what you want your PHP extenstion works
with. Extract PHP source code, and enter its root directory:
$> tar zxvf php-<version>.tar.gz (or tar jxvf php-<version>tar.bz2)
$> cd php-<version>
2. Configure the project, and build and install it. You can specify the directory you want install PHP to
with configure option <i>--prefix</i>:
php-root> ./configure --prefix=<i>prefix_dir</i>; make; make install
3. Then you can find phpize in <i>prefix_dir/bin</i>.
</pre></td></tr></table>
<pre class = "s1"> 3. Configure the project. Before you run configure, check your CUBRID version.
In CUBRID 10.2.x environment, make sure if devtoolset-8 is ready and run the command <B>"scl enable devtoolset-8 bash"</B>.
And you'd better run ./configure -h to see the configure options. For example:</pre>
<pre class = "s3">
cubrid-php> ./configure --with-cubrid --with-php-config=/usr/local/bin/php-config
</pre>
<pre class = "s1"> 4. Build. If it was successfully compiled, the cubrid.so file will be created in the /modules directory:</pre>
<pre class = "s3">
cubrid-php> make
</pre>
<pre class = "s1"> 5. Copy cubrid.so to the extensions directory in lib/php directory which is located inside PHP root directory (/usr/local/php):</pre>
<pre class = "s3">
cubrid-php> mkdir /usr/local/php/lib/php/extensions
cubrid-php> cp modules/cubrid.so /usr/local/php/lib/php/extensions
</pre>
<pre class = "s1"> 6. In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable. For example:</pre>
<pre class = "s3">
extension_dir = "/usr/local/php/lib/php/extensions"
extension = cubrid.so
</pre>
<a name="Test CUBRID PHP Library Installation"></a>
<h3>2.4 Test CUBRID PHP Library Installation</h3>
<pre class = "s1"> 1. Create a test.php file with the following contents:</pre>
<pre class = "s3">
<?php phpinfo(); ?>
</pre>
<pre class = "s1"> 2. Use web browser to visit <u><i>http://localhost/test.php</i></u>, and if you see the following contents, the installation is successful.</pre>
<table width = "500" border="1" >
<tr bgcolor="silver">
<td align="center"><pre class = "s1"> <b>CUBRID</b> </pre></td>
<td align="center"><pre class = "s1"> <b>Value</b> </pre></td>
</tr>
<tr>
<td><pre class = "s1"> Version </pre></td>
<td><pre class = "s1"> 10.x </pre></td>
</tr>
</table>
<a name="Building on Windows x86"></a>
<h2>3. Building on Windows x86</h2>
<pre class = "s1">
In this section we will introduce two ways of building PHP Library for CUBRID:
</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
<b>Which version do I choose? (from windows.php.net)</b>
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC9 versions for PHP5.4.x.
If you are using PHP with IIS you should use the VC9 versions for PHP5.4.x.
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC11 versions for PHP5.6.x or VC14 for PHP7.
If you are using PHP with IIS you should use the VC11 versions for PHP5.6.x or the VC14 for PHP7.
VC9 Versions are compiled with the legacy Visual Studio 2008 compiler;
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability.
VC11 Versions are compiled with the legacy Visual Studio 2012 compiler;
VC11 Versions are compiled with the Visual Studio 2012 compiler and have improvements in performance and stability.
VC14 Versions are compiled with the legacy Visual Studio 2015 compiler;
VC14 Versions are compiled with the Visual Studio 2015 compiler and have improvements in performance and stability.
</pre></td></tr></table>
<a name="Compile CUBRID PHP Library with VC9 for PHP 5.4.x"></a>
<h3> 3.1 Compile CUBRID PHP Library with VC9 for PHP 5.4.x</h3>
<pre class = "s1">
Download CUBRID PHP Library, extract it and enter directory win, you will find Visual Studio 2008 project files
<i>php_cubrid.sln</i> and <i>php_cubrid.vcproj</i>. Before you open the project, you should do some preparations.
</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
<b>Note:</b> When using CUBRID PHP <b>VC9</b> Library with PHP on Windows, make sure that Microsoft Visual C++ 2008
Redistributable Package is installed.
</pre></td></tr></table>
<br>
<a name="Configuring the Environment for VC9"></a>
<h3>3.1.1 Configuring the Environment</h3>
<li>CUBRID 10.x:</li>
<pre class = "s1">Install CUBRID 10.x, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your
system;</pre>
<li>Visual Studio 2008:</li>
<pre class = "s1">You can alternately use the free Visual C++ Express Edition or the VC++ 9 compiler in the Windows SDK 6.1
if you're a makefile master;</pre>
<li>PHP 5.4.x binaries:</li>
<pre class = "s1">You can install VC9 x86 Non Thread Safe or VC9 x86 Thread Safe, and check if the value of system environment
variable <b>%PHPRC%</b> is rightly set;</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC9 project Properties, under the Linker tree node, select the General node, you can see $(PHPRC)
in Additional Library Directories.
</pre></td></tr></table>
<br>
<li>PHP 5.4.x source code:</li>
<pre class = "s1">Remember to get the source that matches your binary version. After you extract the PHP 5.4.x source code,
add system environment variable <b>%PHP5_SRC%</b>, and set its value to the path of PHP 5.4.x source code. </pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC9 project Properties, select the General node from C/C++ tree node. You can see $(PHP5_SRC)
in Additional Include Directories.
</pre></td></tr></table>
<pre class = "s1">
Note: You do not need to build PHP 5.4.x from source, but you do need to configure it. If you don't, VC9 will
tell you that it can't find header file config.w32.h. You can read the wiki page below to get how to configure it.
<a href="http://wiki.php.net/internals/windows/stepbystepbuild">http://wiki.php.net/internals/windows/stepbystepbuild</a>
</pre>
<a name="Build VC9 Library for PHP 5.4.x"></a>
<h3>3.1.2 Build VC9 Library for PHP 5.4.x</h3>
<pre class = "s1"> 1. Open VC9 project under directory win, in the Solution Explorer on the left, right click on the php_cubrid
project name and select Properties;
</pre>
<pre class = "s1"> 2. On the top right corner of the php_cubrid Property Page press Configuration Manager button. In the new window,
select the configure you want for Active solution configuration for Configuration in the Project contexts. There are
four configurations (Release_TS, Release_NTS, Debug_TS and Debug_NTS). Then close the Configuration Manager;
</pre>
<pre class = "s1"> 3. Once you complete the properties modification, press the OK button. Then press F7 to compile;
</pre>
<pre class = "s1"> 4. As we have built php_cubrid.dll we have to make PHP recognize it as an extension:
a) Inside PHP installation folder create the new folder called cubrid, and copy php_cubrid.dll to cubrid folder.
You can also put php_cubrid.dll in %PHPRC%\ext if this directory exists.
b) In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable.
</pre>
<a name="Compile CUBRID PHP Library with VC11 for PHP 5.6.x"></a>
<h3> 3.2 Compile CUBRID PHP Library with VC11 for PHP 5.6.x</h3>
<pre class = "s1">
Download CUBRID PHP Library, extract it and enter directory win, you will find Visual Studio 2012 project files
<i>php_cubrid.sln</i> and <i>php_cubrid.vcproj</i>. Before you open the project, you should do some preparations.
</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
<b>Note:</b> When using CUBRID PHP <b>VC11</b> Library with PHP on Windows, make sure that Microsoft Visual C++ 2012
Redistributable Package is installed.
</pre></td></tr></table>
<br>
<a name="Configuring the Environment for VC11"></a>
<h3>3.2.1 Configuring the Environment</h3>
<li>CUBRID 10.x:</li>
<pre class = "s1">Install CUBRID 10.x, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your
system;</pre>
<li>Visual Studio 2012:</li>
<pre class = "s1">You can alternately use the free Visual C++ Express Edition or the VC++ 11 compiler in the Windows SDK
if you're a makefile master;</pre>
<li>PHP 5.6.x binaries:</li>
<pre class = "s1">You can install VC11 x86 Non Thread Safe or VC11 x86 Thread Safe, and check if the value of system environment
variable <b>%PHPRC%</b> is rightly set;</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC11 project Properties, under the Linker tree node, select the General node, you can see $(PHPRC)
in Additional Library Directories.
</pre></td></tr></table>
<br>
<li>PHP 5.6.x source code:</li>
<pre class = "s1">Remember to get the source that matches your binary version. After you extract the PHP 5.6.x source code,
add system environment variable <b>%PHP5_SRC%</b>, and set its value to the path of PHP 5.6.x source code. </pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC11 project Properties, select the General node from C/C++ tree node. You can see $(PHP5_SRC)
in Additional Include Directories.
</pre></td></tr></table>
<pre class = "s1">
Note: You do not need to build PHP 5.6.x from source, but you do need to configure it. If you don't, VC11 will
tell you that it can't find header file config.w32.h. You can read the wiki page below to get how to configure it.
<a href="http://wiki.php.net/internals/windows/stepbystepbuild">http://wiki.php.net/internals/windows/stepbystepbuild</a>
</pre>
<a name="Build VC11 Library for PHP 5.6.x"></a>
<h3>3.2.2 Build VC11 Library for PHP 5.6.x</h3>
<pre class = "s1"> 1. Open VC11 project under directory win, in the Solution Explorer on the left, right click on the php_cubrid
project name and select Properties;
</pre>
<pre class = "s1"> 2. On the top right corner of the php_cubrid Property Page press Configuration Manager button. In the new window,
select the configure you want for Active solution configuration for Configuration in the Project contexts. There are
four configurations (Release_TS, Release_NTS, Debug_TS and Debug_NTS). Then close the Configuration Manager;
</pre>
<pre class = "s1"> 3. Once you complete the properties modification, press the OK button. Then press F7 to compile;
</pre>
<pre class = "s1"> 4. As we have built php_cubrid.dll we have to make PHP recognize it as an extension:
a) Inside PHP installation folder create the new folder called cubrid, and copy php_cubrid.dll to cubrid folder.
You can also put php_cubrid.dll in %PHPRC%\ext if this directory exists.
b) In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable.
</pre>
<a name="Compile CUBRID PHP Library with VC14 for PHP 7.1.x"></a>
<h3> 3.3 Compile CUBRID PHP Library with VC14 for PHP 7.1.x</h3>
<pre class = "s1">
Download CUBRID PHP Library, extract it and enter directory win, you will find Visual Studio 2015 project files
<i>php_cubrid7.sln</i> and <i>php_cubrid7.vcproj</i>. Before you open the project, you should do some preparations.
</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
<b>Note:</b> When using CUBRID PHP <b>VC14</b> Library with PHP on Windows, make sure that Microsoft Visual C++ 2015
Redistributable Package is installed.
</pre></td></tr></table>
<br>
<a name="Configuring the Environment for VC14"></a>
<h3>3.3.1 Configuring the Environment</h3>
<li>CUBRID 10.x:</li>
<pre class = "s1">Install CUBRID 10.x, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your
system;</pre>
<li>Visual Studio 2015:</li>
<pre class = "s1">You can alternately use the free Visual C++ Express Edition or the VC++ 14 compiler in the Windows SDK
if you're a makefile master;</pre>
<li>PHP 7.1.x binaries:</li>
<pre class = "s1">You can install VC14 x86 Non Thread Safe or VC14 x86 Thread Safe, and check if the value of system environment
variable <b>%PHP7%</b> is rightly set;</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC14 project Properties, under the Linker tree node, select the General node, you can see $(PHP7)
in Additional Library Directories.
</pre></td></tr></table>
<br>
<li>PHP 7.1.x source code:</li>
<pre class = "s1">Remember to get the source that matches your binary version. After you extract the PHP 7.1.x source code,
add system environment variable <b>%PHP7_SRC%</b>, and set its value to the path of PHP 7.1.x source code. </pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC14 project Properties, select the General node from C/C++ tree node. You can see $(PHP7_SRC)
in Additional Include Directories.
</pre></td></tr></table>
<pre class = "s1">
Note: You do not need to build PHP 7.1.x from source, but you do need to configure it. If you don't, VC14 will
tell you that it can't find header file config.w32.h. You can read the wiki page below to get how to configure it.
<a href="http://wiki.php.net/internals/windows/stepbystepbuild">http://wiki.php.net/internals/windows/stepbystepbuild</a>
</pre>
<a name="Build VC14 Library for PHP 7.1.x"></a>
<h3>3.3.2 Build VC14 Library for PHP 7.1.x</h3>
<pre class = "s1"> 1. Open VC14 project under directory win, in the Solution Explorer on the left, right click on the php_cubrid7
project name and select Properties;
</pre>
<pre class = "s1"> 2. On the top right corner of the php_cubrid7 Property Page press Configuration Manager button. In the new window,
select the configure you want for Active solution configuration for Configuration in the Project contexts. There are
four configurations (Release_TS, Release_NTS, Debug_TS and Debug_NTS). Then close the Configuration Manager;
</pre>
<pre class = "s1"> 3. Once you complete the properties modification, press the OK button. Then press F7 to compile;
</pre>
<pre class = "s1"> 4. As we have built php_cubrid.dll we have to make PHP recognize it as an extension:
a) Inside PHP installation folder create the new folder called cubrid, and copy php_cubrid.dll to cubrid folder.
You can also put php_cubrid.dll in %PHP7%\ext if this directory exists.
b) In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable.
</pre>
<a name="Building on Windows x64"></a>
<h2>4. Building on Windows x64</h2>
<pre class = "s1">
This section will guide you through the steps you need to follow to build Windows x64 CUBRID PHP Driver with PHP5.4.x (VC9 environment), PHP 5.6.x (
VC11 environment), and PHP 7.1.x (VC14 environment)
</pre>
<a name="PHP 5.4.x"></a>
<h3> 4.1 PHP 5.4.x</h3>
<a name="Configuring the Environment for VC9 x64"></a>
<h3>4.1.1 Configuring the Environment for PHP 5.4.x</h3>
<li>CUBRID 10.x:</li>
<pre class = "s1">Install CUBRID 10.x, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your
system;</pre>
<li>Visual Studio 2008:</li>
<pre class = "s1">You can alternately use the free Visual C++ Express Edition;</pre>
<li>PHP 5.4.x x64 binaries:</li>
<pre class = "s1">You can build your own VC9 x64 PHP with SDK, or you can get it at <a href="http://www.anindya.com">http://www.anindya.com</a>, both
VC9 x64 Non Thread Safe and VC9 x64 Thread Safe are available. After you have installed it, please check
if the value of system environment variable <b>%PHPRC%</b> is rightly set;</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC9 project Properties, under the Linker tree node, select the General node, you can see $(PHPRC)
in Additional Library Directories.
</pre></td></tr></table>
<br>
<li>PHP 5.4.x source code:</li>
<pre class = "s1">Remember to get the source that matches your binary version. After you extract the PHP 5.4.x source code,
add system environment variable <b>%PHP5_SRC%</b>, and set its value to the path of PHP 5.4.x source code. </pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC9 project Properties, select the General node from C/C++ tree node. You can see $(PHP5_SRC)
in Additional Include Directories.
</pre></td></tr></table>
<pre class = "s1">
Note: You do not need to build PHP 5.4.x from source, but you do need to configure it. If you don't, VC9 will
tell you that it can't find header file config.w32.h. You can read the wiki page below to get how to configure it.
<a href="http://wiki.php.net/internals/windows/stepbystepbuild">http://wiki.php.net/internals/windows/stepbystepbuild</a>
</pre>
<a name="Build x64 VC9 Library for PHP 5.4.x"></a>
<h3>4.1.2 Build x64 VC9 Library for PHP 5.4.x</h3>
<pre class = "s1"> 1. Open VC11 project under directory win, in the Solution Explorer on the left, right click on the php_cubrid
project name and select Properties;
</pre>
<pre class = "s1"> 2. On the top right corner of the php_cubrid Property Page press Configuration Manager button. In the
new window under Active solution configuration, there are four configurations (Release_TS, Release_NTS,
Debug_TS and Debug_NTS). We need to create a new one for our x64 build. For this reason, select the
<New> option. In the new window, input the configuration name (e.g., Release_TS_x64). For the copy
setting from choose the corresponding x86 configuration, in our case Release_TS. Then click "OK".
</pre>
<pre class = "s1"> 3. In the same Configuration Manager window, click the dropdown box under the Platform header label.
If there is x64, choose it, otherwise choose <New...>. In the new window, choose x64 option for
New platform. Press OK and close the Configuration Manager.
</pre>
<pre class = "s1"> 4. Once you complete the properties modification, press the OK button. Then press F7 to compile;
</pre>
<pre class = "s1"> 5. As we have built php_cubrid.dll we have to make PHP recognize it as an extension:
a) Inside PHP installation folder create the new folder called cubrid, and copy php_cubrid.dll to cubrid folder.
You can also put php_cubrid.dll in %PHPRC%\ext if this directory exists.
b) In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable.
</pre>
<a name="PHP 5.6.x"></a>
<h3> 4.2 PHP 5.6.x</h3>
<a name="Configuring the Environment for VC11 x64"></a>
<h3>4.2.1 Configuring the Environment for PHP 5.6.x</h3>
<li>CUBRID 10.x:</li>
<pre class = "s1">Install CUBRID 10.x, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your
system;</pre>
<li>Visual Studio 2012:</li>
<pre class = "s1">You can alternately use the free Visual C++ Express Edition;</pre>
<li>PHP 5.6.x x64 binaries:</li>
<pre class = "s1">You can build your own VC11 x64 PHP with SDK, or you can get it at <a href="http://www.anindya.com">http://www.anindya.com</a>, both
VC11 x64 Non Thread Safe and VC11 x64 Thread Safe are available. After you have installed it, please check
if the value of system environment variable <b>%PHPRC%</b> is rightly set;</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC11 project Properties, under the Linker tree node, select the General node, you can see $(PHPRC)
in Additional Library Directories.
</pre></td></tr></table>
<br>
<li>PHP 5.6.x source code:</li>
<pre class = "s1">Remember to get the source that matches your binary version. After you extract the PHP 5.6.x source code,
add system environment variable <b>%PHP5_SRC%</b>, and set its value to the path of PHP 5.6.x source code. </pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC11 project Properties, select the General node from C/C++ tree node. You can see $(PHP5_SRC)
in Additional Include Directories.
</pre></td></tr></table>
<pre class = "s1">
Note: You do not need to build PHP 5.6.x from source, but you do need to configure it. If you don't, VC11 will
tell you that it can't find header file config.w32.h. You can read the wiki page below to get how to configure it.
<a href="http://wiki.php.net/internals/windows/stepbystepbuild">http://wiki.php.net/internals/windows/stepbystepbuild</a>
</pre>
<a name="Build x64 VC11 Library for PHP 5.6.x"></a>
<h3>4.2.2 Build x64 VC11 Library for PHP 5.6.x</h3>
<pre class = "s1"> 1. Open VC11 project under directory win, in the Solution Explorer on the left, right click on the php_cubrid
project name and select Properties;
</pre>
<pre class = "s1"> 2. On the top right corner of the php_cubrid Property Page press Configuration Manager button. In the
new window under Active solution configuration, there are four configurations (Release_TS, Release_NTS,
Debug_TS and Debug_NTS). We need to create a new one for our x64 build. For this reason, select the
<New> option. In the new window, input the configuration name (e.g., Release_TS_x64). For the copy
setting from choose the corresponding x86 configuration, in our case Release_TS. Then click "OK".
</pre>
<pre class = "s1"> 3. In the same Configuration Manager window, click the dropdown box under the Platform header label.
If there is x64, choose it, otherwise choose <New...>. In the new window, choose x64 option for
New platform. Press OK and close the Configuration Manager.
</pre>
<pre class = "s1"> 4. Once you complete the properties modification, press the OK button. Then press F7 to compile;
</pre>
<pre class = "s1"> 5. As we have built php_cubrid.dll we have to make PHP recognize it as an extension:
a) Inside PHP installation folder create the new folder called cubrid, and copy php_cubrid.dll to cubrid folder.
You can also put php_cubrid.dll in %PHPRC%\ext if this directory exists.
b) In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable.
</pre>
<a name="PHP 7.1.x"></a>
<h3> 4.3 PHP 7.1.x</h3>
<a name="Configuring the Environment for VC14 x64"></a>
<h3>4.3.1 Configuring the Environment for PHP 7.1.x</h3>
<li>CUBRID 10.x:</li>
<pre class = "s1">Install CUBRID 10.x, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your
system;</pre>
<li>Visual Studio 2015:</li>
<pre class = "s1">You can alternately use the free Visual C++ Express Edition;</pre>
<li>PHP 7.1.x x64 binaries:</li>
<pre class = "s1">You can build your own VC14 x64 PHP, or you can get it at <a href="http://www.anindya.com">http://www.anindya.com</a>, both
VC14 x64 Non Thread Safe and VC14 x64 Thread Safe are available. After you have installed it, please check
if the value of system environment variable <b>%PHP7%</b> is rightly set;</pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC14 project Properties, under the Linker tree node, select the General node, you can see $(PHP7)
in Additional Library Directories.
</pre></td></tr></table>
<br>
<li>PHP 7.1.x source code:</li>
<pre class = "s1">Remember to get the source that matches your binary version. After you extract the PHP 7.1.x source code,
add system environment variable <b>%PHP7_SRC%</b>, and set its value to the path of PHP 7.1.x source code. </pre>
<table border="0" bgcolor="silver"> <tr><td><pre class = "s1">
In the VC14 project Properties, select the General node from C/C++ tree node. You can see $(PHP7_SRC)
in Additional Include Directories.
</pre></td></tr></table>
<pre class = "s1">
Note: You do not need to build PHP 7.1.x from source, but you do need to configure it. If you don't, VC14 will
tell you that it can't find header file config.w32.h. You can read the wiki page below to get how to configure it.
<a href="http://wiki.php.net/internals/windows/stepbystepbuild">http://wiki.php.net/internals/windows/stepbystepbuild</a>
</pre>
<a name="Build x64 VC14 Library for PHP 7.1.x"></a>
<h3>4.3.2 Build x64 VC14 Library for PHP 7.1.x</h3>
<pre class = "s1"> 1. Open VC14 project under directory win, in the Solution Explorer on the left, right click on the php_cubrid7
project name and select Properties;
</pre>
<pre class = "s1"> 2. On the top right corner of the php_cubrid7 Property Page press Configuration Manager button. In the
new window under Active solution configuration, there are four configurations (Release_TS, Release_NTS,
Debug_TS and Debug_NTS). We need to create a new one for our x64 build. For this reason, select the
<New> option. In the new window, input the configuration name (e.g., Release_TS_x64). For the copy
setting from choose the corresponding x86 configuration, in our case Release_TS. Then click "OK".
</pre>
<pre class = "s1"> 3. In the same Configuration Manager window, click the dropdown box under the Platform header label.
If there is x64, choose it, otherwise choose <New...>. In the new window, choose x64 option for
New platform. Press OK and close the Configuration Manager.
</pre>
<pre class = "s1"> 4. Once you complete the properties modification, press the OK button. Then press F7 to compile;
</pre>
<pre class = "s1"> 5. As we have built php_cubrid.dll we have to make PHP recognize it as an extension:
a) Inside PHP installation folder create the new folder called cubrid, and copy php_cubrid.dll to cubrid folder.
You can also put php_cubrid.dll in %PHP7%\ext if this directory exists.
b) In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable.
</pre>
</body></html>