首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装php mysqli扩展而不安装mysql服务器

安装php mysqli扩展而不安装mysql服务器
EN

Stack Overflow用户
提问于 2012-12-21 10:35:34
回答 1查看 10.2K关注 0票数 0

在我的linux服务器上,我从源代码安装了php v5.2.14,而没有安装mysql和apache。由于此服务器仅用于运行phpunit,因此不需要安装mysql和apache。问题是一些单元测试需要mysqli扩展。因此,我尝试使用php源代码中的代码安装mysqli扩展。但是,当执行'./configure‘时,它因以下原因而停止:

代码语言:javascript
复制
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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 ANSI C... 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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /home/pu/php
checking for PHP includes... -I/home/pu/php/include/php -I/home/pu/php/include/php/main -I/home/pu/php/include/php/TSRM -I/home/pu/php/include/php/Zend -I/home/pu/php/include/php/ext -I/home/pu/php/include/php/ext/date/lib
checking for PHP extension directory... /home/pu/php/lib/php/extensions/no-debug-non-zts-20060613
checking for PHP installed headers prefix... /home/pu/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for MySQLi support... yes, shared
checking whether to enable embedded MySQLi support... no
mysql_config not found
configure: error: Please reinstall the mysql distribution

所以我想可能是mysql的缺失导致了这个问题。对此有什么解决方案吗。我不想安装mysql服务器,只需安装mysql客户端或驱动程序就足够了。

EN

回答 1

Stack Overflow用户

发布于 2012-12-21 11:16:22

它需要获取编译选项:

代码语言:javascript
复制
mysql_config (1)  - get compile options for compiling clients

我认为你需要php5-mysqlnd。尝试安装它:

代码语言:javascript
复制
$ sudo apt-get install php5-mysqlnd

这个包没有PHP或MySQL作为依赖项:

代码语言:javascript
复制
php5-mysqlnd
  Depends: libc6 (>= 2.15)
  Depends: php5-common (= 5.3.10-1ubuntu3)
  Depends: phpapi-20090626+lfs
libc6
  Depends: libc-bin (= 2.15-0ubuntu10)
  Depends: libgcc1
  Depends: tzdata
libc-bin
libgcc1
  Depends: gcc-4.6-base (= 4.6.3-1ubuntu5)
  Depends: libc6 (>= 2.2.4)
  PreDepends: multiarch-support
gcc-4.6-base
multiarch-support
  Depends: libc6 (>= 2.13-0ubuntu6)
tzdata
  Depends: debconf (>= 0.5)
  Depends: debconf-2.0
debconf
  PreDepends: perl-base (>= 5.6.1-4)
perl-base
  PreDepends: dpkg (>= 1.14.20)
  PreDepends: libc6 (>= 2.11)
dpkg
  PreDepends: coreutils (>= 5.93-1)
  PreDepends: libbz2-1.0
  PreDepends: libc6 (>= 2.11)
  PreDepends: libselinux1 (>= 1.32)
  PreDepends: tar (>= 1.23)
  PreDepends: xz-utils
  PreDepends: zlib1g (>= 1:1.1.4)
coreutils
  Depends: dpkg (>= 1.15.4)
  Depends: install-info
  PreDepends: libacl1 (>= 2.2.51-5)
  PreDepends: libattr1 (>= 1:2.4.46-5)
  PreDepends: libc6 (>= 2.15)
  PreDepends: libselinux1 (>= 1.32)
install-info
  Depends: libc6 (>= 2.4)
libacl1
  Depends: libattr1 (>= 2.4.46-3)
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
libattr1
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
libselinux1
  Depends: libc6 (>= 2.8)
  PreDepends: multiarch-support
libbz2-1.0
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
tar
  PreDepends: libc6 (>= 2.8)
xz-utils
  Depends: libc6 (>= 2.7)
  Depends: liblzma5 (>= 5.1.1alpha+20110809)
liblzma5
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
zlib1g
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
debconf-2.0
php5-common
  Depends: libc6 (>= 2.4)
  Depends: sed (>= 4.1.1-1)
sed
  Depends: dpkg (>= 1.15.4)
  Depends: install-info
  PreDepends: libc6 (>= 2.4)
  PreDepends: libselinux1 (>= 1.32)
phpapi-20090626+lfs

最后,添加--with-mysqli=/usr/bin/mysql_config作为配置选项。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13983542

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档