最新消息: 新版网站上线了!!!

linux下php7安装mysql扩展

首先
git clone https://github.com/php/pecl-database-mysql     mysql   --recursive

phpize
./configure
make
make install

以mac的xampp为例的安装

MacBook-Air:Desktop miyingshuai$ git clone https://github.com/php/pecl-database-mysql mysql --recursive
Cloning into 'mysql'...
remote: Counting objects: 134, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 134 (delta 0), reused 0 (delta 0), pack-reused 130
Receiving objects: 100% (134/134), 108.87 KiB | 38.00 KiB/s, done.
Resolving deltas: 100% (52/52), done.
Checking connectivity... done.
MacBook-Air:Desktop miyingshuai$ cd mysql/
MacBook-Air:mysql miyingshuai$ ls
CREDITS config.w32 php_mysql.c
LICENSE mysql.mak php_mysql.h
README.md mysql_mysqlnd.h php_mysql_structs.h
config.m4 package.xml tests
MacBook-Air:mysql miyingshuai$ phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
MacBook-Air:mysql miyingshuai$ ./configure --with-php-config=/Applications/xampp/xamppfiles/bin/php-config-7.0.3
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-apple-darwin15.2.0
checking host system type... x86_64-apple-darwin15.2.0
checking target system type... x86_64-apple-darwin15.2.0
checking for PHP prefix... /Applications/XAMPP/xamppfiles
checking for PHP includes... -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib
checking for PHP extension directory... /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012
checking for PHP installed headers prefix... /Applications/XAMPP/xamppfiles/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... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for MySQL support... yes, shared
checking for specified location of the MySQL UNIX socket... no
checking for the location of libz... no
checking for MySQL UNIX socket location... no
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
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
谷谷点程序 » linux下php7安装mysql扩展