|
|
编译模块:切换到ext模块目录:
9 |- o2 p$ b; [cd /usr/src/php-8.3.1/ext/mysqli0 _% N* H, U. j- c. {0 V! e( V' c
切换到myqlli目录:
$ ^' [4 z) v7 X3 ~2 o/ C- V. I' |5 Z+ S& r+ Z7 {6 i( E
3 ?8 m4 M5 L! m+ O* G9 y6 c
执行:2 i5 X5 O( Y; X3 W( T0 Y2 p; B
/usr/local/php/bin/phpize
4 j4 v- C Y$ ]0 L" r/ z* WConfiguring for:7 R6 ?* a) l. h& z
PHP Api Version: 20230831
4 m+ A1 e# H" i2 }: fZend Module Api No: 202308311 I. T. O H4 V$ ?2 _. s
Zend Extension Api No: 420230831
& i$ m$ _; Y8 ]8 p2 O; a
0 q7 u+ R/ f2 D: |. t) @7 \要检查config.m4文件 没有就复制一个吧:
6 r. P0 B) x& }, D7 [9 E/ V
! W7 t! M& `6 D, U) K/ `! _$ Z) }& c5 y x) [* j' x) q) Y1 P8 }4 X
通过configure配置php:
, X8 {0 \- _% y$ M) y./configure --with-php-config=/usr/local/php/bin/php-config
% X! l% N1 ]! {) s- e* w% F( k
5 l: ^* ~: l: E9 k5 ]( U8 h& V; l编译并安装:1 l: q1 R3 `0 O5 ^5 V
make && make install
8 l5 A9 [, q- e7 G7 U! c4 F: [
% g$ t* x( p p( S9 [/bin/sh /usr/src/php-8.3.1/ext/mysqli/libtool --mode=link cc -shared -I/usr/src/php-8.3.1/ext/mysqli/include -I/usr/src/php-8.3.1/ext/mysqli/main -I/usr/src/php-8.3.1/ext/mysqli -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -o mysqli.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php-8.3.1/ext/mysqli/modules mysqli.lo mysqli_api.lo mysqli_prop.lo mysqli_nonapi.lo mysqli_report.lo mysqli_driver.lo mysqli_warning.lo mysqli_exception.lo mysqli_result_iterator.lo 1 z! X9 Y( X9 S3 f& Q5 A
cc -shared .libs/mysqli.o .libs/mysqli_api.o .libs/mysqli_prop.o .libs/mysqli_nonapi.o .libs/mysqli_report.o .libs/mysqli_driver.o .libs/mysqli_warning.o .libs/mysqli_exception.o .libs/mysqli_result_iterator.o -Wl,-soname -Wl,mysqli.so -o .libs/mysqli.so
: v' E( s7 t! `2 W3 x2 m& jcreating mysqli.la
" J* r* _( K" ^9 p1 j: ~0 x1 U4 Q(cd .libs && rm -f mysqli.la && ln -s ../mysqli.la mysqli.la)
! l6 n6 l) U: Q" ?0 s2 x+ B/bin/sh /usr/src/php-8.3.1/ext/mysqli/libtool --mode=install cp ./mysqli.la /usr/src/php-8.3.1/ext/mysqli/modules
' V2 _% b, R. c/ D9 W7 H7 qcp ./.libs/mysqli.so /usr/src/php-8.3.1/ext/mysqli/modules/mysqli.so- A4 Z8 z& y# {
cp ./.libs/mysqli.lai /usr/src/php-8.3.1/ext/mysqli/modules/mysqli.la. J: _- a& n3 _! L/ B' t$ l9 `
PATH="$PATH:/sbin" ldconfig -n /usr/src/php-8.3.1/ext/mysqli/modules: a/ z% k( O8 B: [. m$ u- l
----------------------------------------------------------------------) c, p6 ~# v' J: J# ?
Libraries have been installed in:
* ]+ q' X, N1 X6 c8 o3 q /usr/src/php-8.3.1/ext/mysqli/modules7 E ^( D8 H4 ` V! \
% s5 C* x' f" ?" U4 t$ m( a
If you ever happen to want to link against installed libraries
+ \3 P+ V& a T( Qin a given directory, LIBDIR, you must either use libtool, and8 f8 Z: Q3 u+ |
specify the full pathname of the library, or use the `-LLIBDIR'9 B% E5 v: g2 r) o4 h1 G
flag during linking and do at least one of the following:
: w; J1 @4 V" ^4 | - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
+ ~9 W ~% A+ u: {# B7 q7 W& j during execution: u1 |; C4 U) r7 C- ~! U- i
- add LIBDIR to the `LD_RUN_PATH' environment variable
2 K# ]3 @6 h1 C: |1 I# J during linking
5 G3 N4 i8 ?; m; @* F W2 Y: z: P - use the `-Wl,--rpath -Wl,LIBDIR' linker flag) g7 s0 q( K; k/ t4 [* ^8 T
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
. L u; S9 Z) b- t: U$ X0 {9 }* G0 `- g5 d. P
See any operating system documentation about shared libraries for
u( {! C- l* C$ Kmore information, such as the ld(1) and ld.so(8) manual pages.
! J1 ` Z* Q& [+ d% Y9 ]( {----------------------------------------------------------------------
, W& }% f; ^: A& T& z4 }- A+ n6 ?9 X$ i; Q
Build complete.
* H4 z# |) g' yDon't forget to run 'make test'.$ [# O" t6 }1 E! d* n
1 R: h; F/ V) O! iInstalling shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20230831/
2 ~' W4 Z5 V0 L& ~' ]Installing header files: /usr/local/php/include/php/
- w6 A. f* {9 h" s1 P& {0 {
, Q) F, C t% k) F8 W* K; \- W4 `. x去对应的目录检查文件:7 K+ F; H" o' X& A* {6 k& ~( R, X
8 ?' L; V# m8 K/ \8 N' V. e7 m: X[root@ipam2 no-debug-zts-20230831]# ls2 ~% }, j# E. ? U' K: Q8 e* S
mysqli.so! f' L1 C4 j" h$ w5 o; e
( y6 C( b1 v7 [/ H+ X
5 G) f. z* n% w* \' q( k |
|