when learning to install Zabbix, the premise needs to be set up to use the LNMP framework, and when compiling PHP forgot to add bcmath and sockets
Expansion package, found that initially installed without--enable-bcmath 、--enable-sockets, I do not want to remove the reload PHP, fortunately, PHP branch
It is important to generate the corresponding. So file for this extension by adding a extension separately.
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/93/3A/wKioL1kJfJfx4ctaAACXdcKMOhM151.png-wh_500x0-wm_ 3-wmp_4-s_3112701599.png "title=" Qq20170428140530.png "alt=" Wkiol1kjfjfx4ctaaacxdckmohm151.png-wh_50 "/>
To do this, you have the same PHP source code installation package as the PHP version you have installed. I'm using a php-7.0.5.tar.gz.
[Email protected] ~]# TAR-ZXF php-7.0.5.tar.gz
[Email protected] ~]# CD php-7.0.5
[Email protected] php-7.0.5]# CD ext/
[Email protected] ext]# CD bcmath/
[Email protected] bcmath]#/usr/local/php7/bin/phpize
[Email protected] bcmath]#/configure--with-php-config=/usr/local/php7/bin/php-config --enable-bcmath
[email protected] bcmath]# Make
[[email protected] bcmath]# make test
[[email protected] bcmath]# make install
[Email protected] bcmath]# cd/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012
[[email protected] no-debug-non-zts-20151012]# ls
bcmath.so Opcache.a opcache.so
The module has been compiled and is now added into PHP
[email protected] no-debug-non-zts-20151012]# cd/usr/local/php7/etc/
[email protected] etc]# VI php.ini
Add two lines to the last face
extension_dir=/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/
Extension=mbstring.so
Restart PHP and Nginx, test module PLUS.
Problems encountered:
In the compilationBcmathAdd--with-php-config=/usr/local/webserver/php/bin/php-config or the following error will occur
Configure:error:Cannot find Php-config. Please use--with-php-config=path
[[Email protected] Bcmath]#./configure--with-php-config=/usr/local/webserver/php/bin/php-config Normal.
The same method is used to dynamically add the Sockets library module.
PHP Service Source installation package does not have the EXT directory below, if not found the required loading module (for example, Yaf, ffmpeg), you need to download its source code installation package, the decompression operation and the above steps.
This problem was encountered while I was doing the Zabbix experiment and deepened once again in the PHP dynamic loading module.
This article is from the "Mq_douer" blog, make sure to keep this source http://douer.blog.51cto.com/6107588/1921572
PHP dynamic extension Bcmath and sockets library module