PHP补丁[LAMP]

简介: Notice , the argument of  your  configuring the PHP! They are "/usr/src/php-5.3.10/ext [extend]" here! such as:libxml! shell> lsbcmath     libxml    ... and other modules list -------------


Notice , the argument of  your  configuring the PHP! They are "/usr/src/php-5.3.10/ext [extend]" here! such as:libxml!
shell> ls
bcmath     libxml    ... and other modules list

------------------------------------------------------------------------------------------------
If your  programmer need the  bcadd() function , what shoud we do?

http-error:PHP Fatal error:  Call to undefined function bcadd() in /www/test.php on line 5
It's easy! add the php patch!

shell> cd /usr/src/php-5.3.10/ext/bcmath
shell> ls 
…… ///there are no configure file
shell> /usr/local/bin/phpize    //the configure file will be builded!If you reboot your OS, they will disappear again!
shell> ./configure --enable-bcmath --with-php-config=/usr/local/bin/php-config
shell> make  
shell> make install
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
------------------------------>
shell> ls /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
bcmath.o

------------------------------> /usr/local/lib/php.ini

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626/"     //the path of patch!

extension="bcmath.so"

------------------------------>
restart your apache!

-----------------------------> /www/test.php

<?php
$a = '1.234';
$b = '5';

echo bcadd($a, $b) . "<br>";     // 6
echo bcadd($a, $b, 4);  // 6.2340
?>

PS: 另外,如果这样扩展模块失败的话,当然还可以重新编译一次PHP呗!将新编译好的,做一个软链呗!


目录
相关文章
|
25天前
|
运维 Linux Apache
LAMP架构调优(十)——Apache禁止指定目录PHP解析与错误页面优化
LAMP架构调优(十)——Apache禁止指定目录PHP解析与错误页面优化
197 2
|
弹性计算 运维 监控
如何基于阿里云的ecs搭建lamp的php生产环境-基于宝塔面板
如何基于阿里云的ecs搭建lamp的php生产环境-基于宝塔面板
299 0
|
Ubuntu 关系型数据库 PHP
Ubuntu 安装php环境 lamp 搭建网站
Ubuntu 安装php环境 lamp 搭建网站
3375 0
|
关系型数据库 MySQL PHP
|
Web App开发 关系型数据库 MySQL