ubuntu18.04安装php7.1.14记录

刚装好系统,需要安装nginx,php。

需要安装php7.1.14,记录如下

./configure –prefix=/usr/local/php –exec-prefix=/usr/local/php –mandir=/usr/local/php/php/man –libdir=/usr/local/php/lib/php –includedir=/usr/local/php/include –sbindir=/usr/local/php/sbin –bindir=/usr/local/php/bin –with-config-file-path=/usr/local/php/etc –with-config-file-scan-dir=/usr/local/php/etc/php.d –enable-opcache –disable-fileinfo –enable-mysqlnd –with-mysqli –with-pdo-mysql –with-iconv=/usr/local/libiconv –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-bcmath –enable-shmop –enable-exif –enable-sysvsem –enable-inline-optimization –with-curl –enable-mbregex –enable-mbstring –with-mcrypt –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-ftp –enable-intl –with-xsl –with-gettext –enable-zip –enable-soap –disable-ipv6 –disable-debug –enable-fpm -with-icu-dir=/usr -with-xsl –enable-fast-install –enable-session –without-pear –enable-shared –with-apxs2

———————————————————

./configure –prefix=/usr/local/php –exec-prefix=/usr/local/php –mandir=/usr/local/php/php/man –libdir=/usr/local/php/lib/php –includedir=/usr/local/php/include –sbindir=/usr/local/php/sbin –bindir=/usr/local/php/bin –with-config-file-path=/usr/local/php/etc –with-config-file-scan-dir=/usr/local/php/etc/php.d –enable-opcache –disable-fileinfo –enable-mysqlnd –with-mysqli –with-pdo-mysql –with-iconv=/usr/local/libiconv –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-bcmath –enable-shmop –enable-exif –enable-sysvsem –enable-inline-optimization –with-curl –enable-mbregex –enable-mbstring –with-mcrypt –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-ftp –enable-intl –with-xsl –with-gettext –enable-zip –enable-soap –disable-ipv6 –disable-debug –enable-fpm -with-icu-dir=/usr -with-xsl –enable-fast-install –enable-session –without-pear –enable-shared

———————————————————–

Configuring extensions
checking size of long… (cached) 8
checking size of int… (cached) 4
checking for int32_t… yes
checking for uint32_t… yes
checking for sys/types.h… (cached) yes
checking for inttypes.h… (cached) yes
checking for stdint.h… (cached) yes
checking for string.h… (cached) yes
checking for stdlib.h… (cached) yes
checking for strtoll… yes
checking for atoll… yes
checking for strftime… (cached) yes
checking for gettimeofday… (cached) yes
checking whether to enable LIBXML support… yes
checking libxml2 install dir… /usr
checking for xml2-config path…
configure: error: xml2-config not found. Please check your libxml2 installation.
[email protected]:~/Downloads/php-7.1.14$ sudo apt-get install libxml2
Reading package lists… Done
Building dependency tree
Reading state information… Done
libxml2 is already the newest version (2.9.4+dfsg1-6.1ubuntu1.2).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
[email protected]:~/Downloads/php-7.1.14$ sudo apt-get install libxml2-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
gir1.2-harfbuzz-0.0 icu-devtools libglib2.0-dev libglib2.0-dev-bin
libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libicu-dev
libicu-le-hb-dev libicu-le-hb0 libiculx60 libpcre16-3 libpcre3-dev
libpcre32-3 libpcrecpp0v5 pkg-config python3-distutils python3-lib2to3
zlib1g-dev
Suggested packages:
libglib2.0-doc libgraphite2-utils icu-doc
The following NEW packages will be installed:
gir1.2-harfbuzz-0.0 icu-devtools libglib2.0-dev libglib2.0-dev-bin
libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libicu-dev
libicu-le-hb-dev libicu-le-hb0 libiculx60 libpcre16-3 libpcre3-dev
libpcre32-3 libpcrecpp0v5 libxml2-dev pkg-config python3-distutils
python3-lib2to3 zlib1g-dev
0 upgraded, 20 newly installed, 0 to remove and 6 not upgraded.
Need to get 13.0 MB/13.0 MB of archives.
After this operation, 63.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

———————————————————–

Configuring extensions
checking size of long… (cached) 8
checking size of int… (cached) 4
checking for int32_t… yes
checking for uint32_t… yes
checking for sys/types.h… (cached) yes
checking for inttypes.h… (cached) yes
checking for stdint.h… (cached) yes
checking for string.h… (cached) yes
checking for stdlib.h… (cached) yes
checking for strtoll… yes
checking for atoll… yes
checking for strftime… (cached) yes
checking for gettimeofday… (cached) yes
checking whether to enable LIBXML support… yes
checking libxml2 install dir… /usr
checking for xml2-config path… /usr/bin/xml2-config
checking whether libxml build works… yes
checking for OpenSSL support… yes
checking for Kerberos support… no
checking whether to use system default cipher list instead of hardcoded value… no
checking for RAND_egd… no
checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>

[email protected]:~/Downloads/php-7.1.14$ sudo apt-get install libcurl4-openssl-dev pkg-config
Reading package lists… Done
Building dependency tree
Reading state information… Done
pkg-config is already the newest version (0.29.1-0ubuntu2).
pkg-config set to manually installed.
Suggested packages:
libcurl4-doc libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev
libssl-dev
The following NEW packages will be installed:
libcurl4-openssl-dev
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 295 kB of archives.
After this operation, 1,398 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libcurl4-openssl-dev amd64 7.58.0-2ubuntu3.6 [295 kB]
Fetched 295 kB in 2s (179 kB/s)
Selecting previously unselected package libcurl4-openssl-dev:amd64.
(Reading database … 212905 files and directories currently installed.)
Preparing to unpack …/libcurl4-openssl-dev_7.58.0-2ubuntu3.6_amd64.deb …
Unpacking libcurl4-openssl-dev:amd64 (7.58.0-2ubuntu3.6) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …
Setting up libcurl4-openssl-dev:amd64 (7.58.0-2ubuntu3.6) …

ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib64

sudo apt-get install libssl-dev

———————————————————–

checking for the location of libjpeg… yes
checking for the location of libpng… yes
checking for the location of libXpm… no
checking for FreeType 2… yes
checking whether to enable truetype string function in GD… yes
checking whether to enable JIS-mapped Japanese font support in GD… no
If configure fails try –with-webp-dir=<DIR>
configure: error: jpeglib.h not found.
[email protected]:~/Downloads/php-7.1.14$ sudo apt-get install libjpeg-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libjpeg-turbo8-dev libjpeg8-dev
The following NEW packages will be installed:
libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev
0 upgraded, 3 newly installed, 0 to remove and 6 not upgraded.
Need to get 229 kB of archives.
After this operation, 858 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

———————————————————–

checking for FreeType 2… yes
checking whether to enable truetype string function in GD… yes
checking whether to enable JIS-mapped Japanese font support in GD… no
If configure fails try –with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg… yes
configure: error: png.h not found.
[email protected]:~/Downloads/php-7.1.14$ sudo apt-get install libpng-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libpng-tools
The following NEW packages will be installed:
libpng-dev libpng-tools
0 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
Need to get 203 kB of archives.
After this operation, 703 kB of additional disk space will be used.
Do you want to continue? [Y/n]

———————————————————–

checking for the location of libwebp… no
checking for the location of libjpeg… yes
checking for the location of libpng… yes
checking for the location of libXpm… no
checking for FreeType 2… yes
checking whether to enable truetype string function in GD… yes
checking whether to enable JIS-mapped Japanese font support in GD… no
If configure fails try –with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg… yes
checking for png_write_image in -lpng… yes
If configure fails try –with-xpm-dir=<DIR>
configure: error: freetype-config not found.
[email protected]:~/Downloads/php-7.1.14$ sudo apt-get install libfreetype6-devReading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
libfreetype6-dev
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 2,539 kB of archives.
After this operation, 6,162 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 libfreetype6-dev amd64 2.8.1-2ubuntu2 [2,539 kB]
Fetched 2,539 kB in 3s (832 kB/s)
Selecting previously unselected package libfreetype6-dev:amd64.
(Reading database … 216269 files and directories currently installed.)
Preparing to unpack …/libfreetype6-dev_2.8.1-2ubuntu2_amd64.deb …
Unpacking libfreetype6-dev:amd64 (2.8.1-2ubuntu2) …
Setting up libfreetype6-dev:amd64 (2.8.1-2ubuntu2) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …

—————————————————–

checking size of long… (cached) 8
checking size of long long… (cached) 8
checking for iconv support… yes
configure: error: Please reinstall the iconv library.

2
3
4
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
$ ./configure –prefix=/usr/local
$ make
$ make install

————————————————

checking for working memcmp… yes
checking for stdarg.h… (cached) yes
checking for mcrypt support… yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.

sudo apt-get install libmcrypt-dev

————————————————–

checking for xml2-config path… (cached) /usr/bin/xml2-config
checking whether libxml build works… (cached) yes
checking for XSL support… yes
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

[email protected]:~/Downloads/php-7.1.14$ sudo apt-get install libxslt1-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
libxslt1-dev
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 407 kB of archives.
After this operation, 2,473 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 libxslt1-dev amd64 1.1.29-5 [407 kB]
Fetched 407 kB in 3s (137 kB/s)
Selecting previously unselected package libxslt1-dev:amd64.
(Reading database … 216516 files and directories currently installed.)
Preparing to unpack …/libxslt1-dev_1.1.29-5_amd64.deb …
Unpacking libxslt1-dev:amd64 (1.1.29-5) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …
Setting up libxslt1-dev:amd64 (1.1.29-5) …

———————————————

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据