php - 错误:使用 pecl 安装 pdo 和 pdo_mysql 时“make”失败
问题描述
Ubuntu 20.04 PHP 7.4
服务器只安装了Apache2
, MySQL
,PHP
和它们的依赖。
Surindaku@Flarum:~$ sudo pecl install PDO PDO_MYSQL
Starting to download PDO-1.0.3.tgz (52,613 bytes)
.............done: 52,613 bytes
downloading PDO_MYSQL-1.0.2.tgz ...
Starting to download PDO_MYSQL-1.0.2.tgz (14,778 bytes)
...done: 14,778 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
building in /tmp/pear/temp/pear-build-root4OSLDd/PDO-1.0.3
running: /tmp/pear/temp/PDO/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local/php
checking for PHP includes... -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
checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-debug-zts-20180731
checking for PHP installed headers prefix... /usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... yes
checking for re2c... re2c
checking for re2c version... 2.2 (ok)
checking for gawk... gawk
checking whether to enable PDO support... yes, shared
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /tmp/pear/temp/pear-build-root4OSLDd/PDO-1.0.3/libtool --mode=compile cc -I. -I/tmp/pear/temp/PDO -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root4OSLDd/PDO-1.0.3/include -I/tmp/pear/temp/pear-build-root4OSLDd/PDO-1.0.3/main -I/tmp/pear/temp/PDO -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 -c /tmp/pear/temp/PDO/pdo.c -o pdo.lo
mkdir .libs
cc -I. -I/tmp/pear/temp/PDO -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root4OSLDd/PDO-1.0.3/include -I/tmp/pear/temp/pear-build-root4OSLDd/PDO-1.0.3/main -I/tmp/pear/temp/PDO -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 -c /tmp/pear/temp/PDO/pdo.c -fPIC -DPIC -o .libs/pdo.o
make: *** [Makefile:219: pdo.lo] Error 1
ERROR: `make' failed
解决方案
推荐阅读
- php - Magento 2 事件 save_commit_after 未触发
- google-sheets - 向数组添加前缀列
- python - TowerPro SG90 连续旋转 360 度伺服电机的输入逐步角度增量
- python - 由于页面加载,tkinter 列表超出范围
- c# - System.ComponentModel.DataAnnotations 验证属性未按预期工作
- vue.js - Nuxtjs - 我的 nuxt 项目发生了什么
- reactjs - Apollo 客户端:不能把 ReactHook 放在 Conditional 之后,但是 React Hook 需要数据只有在有条件之后才可用?
- python - 在Python中检查多个值是否在数组中的最佳方法
- elasticsearch - Elasticsearch、函数得分、自定义 score_mode(不是简单的求和/乘法)
- javascript - 如何在标题中自定义 wordpress 菜单项