php5.6 mac 编译安装错误

解决方法:https://bugs.php.net/bug.php?id=71343

详细报错:

Undefined symbols for architecture x86_64:

“_append_history”, referenced from:

_readline_shell_run in readline_cli.o

“_history_list”, referenced from:

_zif_readline_list_history in readline.o

“_libiconv”, referenced from:

_zif_iconv_substr in iconv.o

_zif_iconv_mime_encode in iconv.o

_php_iconv_string in iconv.o

__php_iconv_strlen in iconv.o

__php_iconv_strpos in iconv.o

__php_iconv_appendl in iconv.o

_php_iconv_stream_filter_append_bucket in iconv.o

“_libiconv_close”, referenced from:

_zif_iconv_substr in iconv.o

_zif_iconv_mime_encode in iconv.o

_php_iconv_string in iconv.o

__php_iconv_strlen in iconv.o

__php_iconv_strpos in iconv.o

__php_iconv_mime_decode in iconv.o

_php_iconv_stream_filter_factory_create in iconv.o

“_libiconv_open”, referenced from:

_zif_iconv_substr in iconv.o

_zif_iconv_mime_encode in iconv.o

_php_iconv_string in iconv.o

__php_iconv_strlen in iconv.o

__php_iconv_strpos in iconv.o

__php_iconv_mime_decode in iconv.o

_php_iconv_stream_filter_factory_create in iconv.o

“_rl_done”, referenced from:

_zif_readline_info in readline.o

“_rl_mark”, referenced from:

_zif_readline_info in readline.o

“_rl_pending_input”, referenced from:

_zif_readline_info in readline.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [sapi/cli/php] Error 1

php5.6 编译安装

./configure –prefix=/usr/local/php56 –with-config-file-path=/usr/local/php56/etc –enable-inline-optimization –disable-debug –disable-rpath –enable-shared –enable-opcache –enable-fpm –with-fpm-user=www –with-fpm-group=www –with-mysql=mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –with-gettext=/usr/local/Cellar/gettext/0.19.8.1 –enable-mbstring –with-iconv=/usr/local/Cellar/libiconv/1.15 –with-mcrypt –with-mhash –with-openssl=”/usr/local/Cellar/openssl/1.0.2p” –enable-bcmath –enable-soap –with-libxml-dir –enable-pcntl –enable-shmop –enable-sysvmsg –enable-sysvsem –enable-sysvshm –enable-sockets –with-curl=”/usr/local/Cellar/curl/7.63.0″ –with-zlib=”/usr/local/Cellar/zlib/1.2.11″ –enable-zip –with-bz2=/usr/local/Cellar/bzip2/1.0.6_1 –with-readline=/usr/local/Cellar/readline/7.0.5

make

make install

git 文件恢复

https://blog.csdn.net/chao_1990/article/details/81746691

https://git-scm.com/book/zh/v1/Git-%E5%86%85%E9%83%A8%E5%8E%9F%E7%90%86-%E7%BB%B4%E6%8A%A4%E5%8F%8A%E6%95%B0%E6%8D%AE%E6%81%A2%E5%A4%8D

使用phpize安装php扩展

https://www.cnblogs.com/xjnotxj/p/6125305.html

 

一、方法

  1. 下载源码
  2. 解压源码
  3. 进入源码目录
  4. /Applications/XAMPP/bin/phpize
  5. ./configure –with-php-config=/Applications/XAMPP/bin/php-config

 

二、错误 & 解决方法

 

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

1. 下载、编译、安装m4、autoconf,这里是地址

2. ~/.bash_profile 加入如下内容(根据实际需求变化):

export PHP_AUTOCONF=/usr/local/bin/autoconf

3. source ~/.bash_profile 应用变化

 

./memcache_pool.h:45:10: fatal error: ‘ext/standard/php_smart_str_public.h’ file not found