ubuntu22 编译安装php74

ub22 with openssl 1.1.1u

1
2
3
./Configure --prefix=/usr/local/openssl --openssldir=/usr/local/openssl -fPIC -shared linux-x86_64
make -j8 && make install
echo /usr/local/openssl/lib > /etc/ld.so.conf.d/openssl.conf

curl 7.88.1

1
2
./configure --prefix=/usr/local/curl --with-ssl=/usr/local/openssl
make -j 8 && make install

install icu 70.x

1
2
./configure --prefix=/usr/local
make -j 8 && make install

install php

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
export OPENSSL_CONF=/usr/lib/ssl/openssl.cnf
export PKG_CONFIG_PATH=/usr/local/openssl/lib/pkgconfig:/usr/local/curl/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/local/openssl/lib:/usr/local/curl/lib

'./configure' \
'--prefix=/usr/local/php/74' \
'--with-config-file-path=/usr/local/php/74/etc' \
'--with-config-file-scan-dir=/usr/local/php/74/etc/php.d' \
'--with-fpm-user=www' \
'--with-fpm-group=www' \
'--enable-fpm' \
'--enable-opcache' \
'--disable-fileinfo' \
'--enable-mysqlnd' \
'--with-mysqli=mysqlnd' \
'--with-pdo-mysql=mysqlnd' \
'--with-iconv-dir=/usr/local/libiconv' \
'--with-freetype' \
'--with-jpeg' \
'--with-zlib' \
'--enable-xml' \
'--disable-rpath' \
'--enable-bcmath' \
'--enable-shmop' \
'--enable-exif' \
'--enable-sysvsem' \
'--enable-inline-optimization' \
'--with-curl=/usr/local/curl' \
'--enable-mbregex' \
'--enable-mbstring' \
'--with-password-argon2' \
'--with-sodium=/usr/local' \
'--enable-gd' \
'--with-openssl=/usr/local/openssl' \
'--with-openssl-dir=/usr/local/openssl' \
'--with-mhash' \
'--enable-pcntl' \
'--enable-sockets' \
'--with-xmlrpc' \
'--enable-ftp' \
'--enable-intl' \
'--with-xsl' \
'--with-gettext' \
'--with-zip=/usr/local' \
'--enable-soap' \
'--disable-debug' \
'PKG_CONFIG_PATH=/usr/local/openssl/lib/pkgconfig:/usr/local/curl/lib/pkgconfig'

make ZEND_EXTRA_LIBS='-liconv' -j 8