编译安装(php-5.6.23)
1.进入php源码包目录下的ext/bcmath目录。
[root@192 bcmath]# lsbcmath.c config.m4 config.w32 credits libbcmath package.xml php_bcmath.h tests
2.执行phpize命令,phpize命令在php安装目录的bin目录下,如/usr/local/php/bin/phpize。
[root@192 bcmath]# /usr/local/php/bin/phpizeconfiguring for:php api version: 20131106zend module api no: 20131226zend extension api no: 220131226
3.执行./configure –with-php-config=/usr/local/php/bin/php-config。要依据php-config的实际路径。
[root@192 bcmath]# ./configure --with-php-config=/usr/local/php/bin/php-configchecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -echecking for a d that does not truncate output... /usr/bin/dchecking for cc... ccchecking whether the c compiler works... yeschecking for c compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the gnu c compiler... yeschecking whether cc accepts -g... yeschecking for cc option to accept iso c89... none neededchecking how to run the c preprocessor... cc -echecking for icc... nochecking for suncc... nochecking whether cc understands -c and -o together... yeschecking for system library directory... libchecking if compiler supports -r... nochecking if compiler supports -wl,-rpath,... yeschecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type... x86_64-unknown-linux-gnuchecking for php prefix... /usr/local/phpchecking 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/libchecking for php extension directory... /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226checking for php installed headers prefix... /usr/local/php/include/phpchecking if debug is enabled... nochecking if zts is enabled... nochecking for re2c... noconfigure: warning: you will need re2c 0.13.4 or later if you want to regenerate php parrs.checking for gawk... gawkchecking whether to enable bc style precision math functions... yes, sharedchecking for ld ud by cc... /usr/bin/ldchecking if the linker (/usr/bin/ld) is gnu休戚与共的意思 ld... yeschecking for /usr/bin/ld option to reload object files... -rchecking for bsd-compatible nm... /usr/bin/nm -bchecking whether ln -s works... yeschecking how to recognize dependent libraries... pass_allchecking for ansi c header files... yeschecking for sy教育培训班s/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking dlfcn.h usability... yeschecking dlfcn.h prence... yeschecking for dlfcn.h... yeschecking the maximum length of command line arguments... 1572864checking command to par /usr/bin/nm -b output from cc object... okchecking for objdir... .libschecking for ar... archecking for ranlib... ranlibchecking for strip... stripchecking if cc supports -fno-rtti -fno-exceptions... nochecking for cc option to produce pic... -fpicchecking if cc pic flag -fpic works... yeschecking if cc static flag -static works... nochecking if cc supports -c -o file.o... yeschecking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yeschecking whether -lc should be explicitly linked in... nochecking dynamic linker characteristics... gnu/linux ld.sochecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries照样的近义词... yeschecking whether to build shared libraries... yeschecking whether to build static libraries... nocreating libtoolappending configuration tag "cxx" to libtoolconfigure: creating ./config.statusconfig.status: creating config.h
4.执行make && make install。
[root@192 bcmath]# make && make install/bin/sh /home/tools/phptools/php-5.6.23/ext/bcmath/libtool --mode=compile cc -i/home/tools/phptools/php-5.6.23/ext/bcmath/libbcmath/src -i. -i/home/tools/phptools/php-5.6.23/ext/bcmath -dphp_atom_inc -i/home/tools/phptools/php-5.6.23/ext/bcmath/include -i/home/tools/phptools/php-5.6.23/ext/bcmath/main -i/home/tools/phptools/php-5.6.23/ext/bcmath -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_codie的名词nfig_h -g -o2 -c 读什么书好/home/tools/phptools/php-5.6.23/ext/bcmath/bcmath.c -o bcmath.lo mkdir .libs cc -i/home/tools/phptools/php-5.6.23/ext/bcmath/libbcmath/src -i. -i/home/tools/phptools/php-5.6.23/ext/bcmath -dphp_atom_inc -i/home/tools/phptools/php-5.6.23/ext/bcmath/include -i/home/tools/phptools/php-5.6.23/ext/bcmath/main -i/home/tools/phptools/php-5.6.23/ext/bcmath -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 /home/tools/phptools/php-5.6.23/ext/bcmath/bcmath.c -fpic -dpic -o .libs/bcmath.o... ...----------------------------------------------------------------------libraries have been installed in: /home/tools/phptools/php-5.6.23/ext/bcmath/modulesif you ever happen to want to link against installed librariesin a given directory, libdir, you must either u libtool, andspecify the full pathname of the library, or u the `-llibdir'flag during linking and do at least one of the following: - add libdir to the `ld_library_path' environment variable during execution - add libdir to the `ld_run_path' environment variable during linking - u the `-wl,--rpath -wl,libdir' linker flag - have your system administrator add libdir to `/etc/ld.so.conf'e any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------build complete.don't forget to run 'make test'.installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
5.查询,php.ini中extension_dir配置的目录中已经有bcmath.so文件了。
[root@192 sbin]# ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/总用量 3984-rwxr-xr-x. 1 root root 382568 10月 22 17:57 bcmath.so
6.在dynamic extensions配置块下添加一行extension=bcmath.so。
7.重启php服务即可。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对www.887551.com的支持。如果你想了解更多相关内容请查看下面相关链接
本文发布于:2023-04-06 15:35:43,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/e54fb126e8fb020a82adad25aba1984d.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:PHP安装BCMath扩展的方法.doc
本文 PDF 下载地址:PHP安装BCMath扩展的方法.pdf
留言与评论(共有 0 条评论) |