{"id":25,"date":"2024-09-19T11:41:33","date_gmt":"2024-09-19T03:41:33","guid":{"rendered":"http:\/\/log.d9t3.com\/?p=25"},"modified":"2024-09-19T11:41:33","modified_gmt":"2024-09-19T03:41:33","slug":"centos%e5%ae%89%e8%a3%85php%e6%89%a9%e5%b1%95%ef%bc%88bcmath%ef%bc%89","status":"publish","type":"post","link":"https:\/\/log.d9t3.com\/?p=25","title":{"rendered":"centos\u5b89\u88c5PHP\u6269\u5c55\uff08bcmath\uff09"},"content":{"rendered":"\n<p>Centos\u4e0b\u642d\u5b8cMysql+Apache+PHP\u540e\uff0c\u53d1\u73b0\u6709\u4e9b\u7f51\u9875\u6253\u5f00\u662f\u7a7a\u767d\u7684\u3002<br>\u5c06php.ini\u91cc\u9762\u7684\u53c2\u6570<\/p>\n\n\n\n<p>error_reporting = E_ALL\uff0cdisplay_errors = On\uff0cdisplay_startup_errors = On<\/p>\n\n\n\n<p>\u8bbe\u7f6e\u5b8c\u540e\uff0c\u4f1a\u5728\u7f51\u9875\u4e0a\u663e\u793a\u9519\u8bef\u539f\u56e0<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"page-subtitle\">Fatal error: Call to undefined function bcmath() in \/var\/www\/html\/&#8230; on line 95<br>\u5728\u7f51\u4e0a\u67e5\u627e\u539f\u56e0\u662f\u7531\u4e8ephp\u6ca1\u52a0\u4e0abcmath\u6269\u5c55\u7684\u539f\u56e0\uff0c\u4e8e\u662f\u7528\u4e0b\u9762\u65b9\u6cd5\u6dfb\u52a0\u4e86\u5c31OK\u4e86\uff01<br>\u5bf9\u4e8ephpize\u5b89\u88c5\uff0c\u5728linux\u673a\u5668\u4e0a\uff0c\u6709yum\u547d\u4ee4\u5c31\u884c\u3002phpize\u662f\u5c5e\u4e8ephp-devel\u7684\u5185\u5bb9\uff0c\u6240\u4ee5\u53ea\u8981\u8fd0\u884cyum install php-devel\u5c31\u884c\u3002<\/h1>\n\n\n\n<p>\u4e1c\u897f\u591a\u5bb9\u6613\u5fd8\u8bb0\uff01\u5199\u4e0b\u6765\u5907\u4efd\uff1b<\/p>\n\n\n\n<p>linux\u4e0b\u7528phpize\u7ed9PHP\u52a8\u6001\u6dfb\u52a0\u6269\u5c55<\/p>\n\n\n\n<p>\u4f7f\u7528php\u7684\u5e38\u89c1\u95ee\u9898\u662f\u7f16\u8bd1php\u65f6\u5fd8\u8bb0\u6dfb\u52a0\u67d0\u6269\u5c55\uff0c\u540e\u6765\u60f3\u6dfb\u52a0\u6269\u5c55\uff0c\u4f46\u662f\u56e0\u4e3a\u5b89\u88c5php\u540e\u53c8\u88c5\u4e86\u4e00\u4e9b\u4e1c\u897f\u5982PEAR\u7b49\uff0c\u4e0d\u60f3\u5220\u9664\u76ee\u5f55\u91cd\u88c5\uff0c\u8fd9\u91cc\u5c31\u9700\u8981\u7528\u5230phpize\u4e86\u3002<\/p>\n\n\n\n<p>\u5982\u6211\u60f3\u589e\u52a0bcmath\u6269\u5c55\u7684\u652f\u6301\uff0c\u8fd9\u662f\u4e00\u4e2a\u652f\u6301\u5927\u6574\u6570\u8ba1\u7b97\u7684\u6269\u5c55\u3002windows\u81ea\u5e26\u800c\u4e14\u5185\u7f6e\uff0clinux\u201c\u672c\u7c7b\u51fd\u6570\u4ec5\u5728 PHP \u7f16\u8bd1\u65f6\u914d\u7f6e\u4e86&nbsp;&#8211;enable-bcmath&nbsp;\u65f6\u53ef\u7528\u201d\uff08\u5f15\u53f7\u5185\u662f\u624b\u518c\u4e2d\u7684\u8bdd\uff09<\/p>\n\n\n\n<p>\u6ce8\u610f,\u6709\u4e9b\u6269\u5c55\u9700\u8981\u548cphp\u7684\u7248\u672c\u4fdd\u6301\u4e00\u81f4\u624d\u53ef\u4ee5\u7684\uff0c\u6240\u4ee5\u4e0b\u8f7dphp\u5305\u65f6\u5c3d\u91cf\u4fdd\u6301\u548c\u5df2\u5b89\u88c5\u7684php\u5305\u7248\u672c\u4e00\u81f4\u3002\u6bd4\u5982\uff0c\u6211\u5b89\u88c5\u7684\u4e3aphp5.1.6\uff0c\u5c31\u4e0b\u8f7dphp-5.1.6.tar.gz\u7684\u5305<\/p>\n\n\n\n<p>\u89e3\u538bphp-5.1.6.tar.gz\u5305,\u8fdb\u5165\u91cc\u9762\u7684ext\/bcmath\u76ee\u5f55,\u7136\u540e\u6267\u884c\/usr\/local\/php\/bin\/phpize\uff0c\uff08\u5176\u5b9e\u5728PHP\u6e90\u7801\u5b89\u88c5\u5305\u91cc\u9762\u8fdb\u884c\uff0c\u6b64\u5904\u7684\u8def\u5f84\u4e0d\u7edd\u5bf9\uff0c\u6309\u81ea\u5df1\u7684\u8def\u5f84\u8f93\u5165\uff09phpize\u5728php\u5b89\u88c5\u5b8c\u4ee5\u540e\u4f1a\u6709\u8fd9\u4e2a\u547d\u4ee4\u7684, \u4f1a\u53d1\u73b0\u5f53\u524d\u76ee\u5f55\u4e0b\u591a\u4e86\u4e00\u4e9bconfigure\u6587\u4ef6\uff0c\u7136\u540e\u518d\u6267\u884c.\/configure\u547d\u4ee4\u5373\u53ef.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/static.oschina.net\/uploads\/space\/2012\/1010\/172637_nFFw_4731.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"http:\/\/static.oschina.net\/uploads\/space\/2012\/1010\/172637_nFFw_4731.jpg\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>#\/usr\/local\/php\/bin\/phpize<br>#.\/configure&nbsp;&#8211;with-php-config=\/usr\/local\/php\/bin\/php-config<\/p>\n<\/blockquote>\n\n\n\n<p>\u6ce8\u610f\u8981\u5148\u786e\u4fdd\/usr\/local\/php\/bin\/php-config\u5b58\u5728\u3002 (\u5982\u679c\u4f60\u7684php\u5b89\u88c5\u8def\u5f84\u4e0d\u662f\u9ed8\u8ba4\u7684,\u8bf7\u4fee\u6539\u4e3aphp\u5b89\u88c5\u7684\u8def\u5f84)<\/p>\n\n\n\n<p>\u5982\u679c\u6ca1\u6709\u62a5\u9519\uff0c\u5219make\uff0c\u518dmake install \uff0c\u7136\u540e\u5b83\u544a\u8bc9\u4f60\u4e00\u4e2a\u76ee\u5f55.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>#make<br>#make install<\/p>\n<\/blockquote>\n\n\n\n<p>\u4f60\u628a\u8be5\u76ee\u5f55\u4e0b\u7684bcmath.so\u62f7\u8d1d\u5230\u4f60php.ini\u4e2d\u7684extension_dir\u6307\u5411\u7684\u76ee\u5f55\u4e2d\uff0c<\/p>\n\n\n\n<p>\u4fee\u6539php.ini,\u5728\u6700\u540e\u6dfb\u52a0\u4e00\u53e5<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>extension=bcmath.so<\/p>\n<\/blockquote>\n\n\n\n<p>\u91cd\u542fWEB\u670d\u52a1\uff0c\u518d\u6267\u884cphpinfo(),\u60ca\u559c\u53d1\u73b0\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/blog.haohtml.com\/wp-content\/uploads\/2010\/10\/bcmath.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"http:\/\/blog.haohtml.com\/wp-content\/uploads\/2010\/10\/bcmath.png\" alt=\"\" title=\"bcmath\"\/><\/a><\/figure>\n\n\n\n<p>\u5230\u6b64bcmath\u6269\u5c55\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Centos\u4e0b\u642d\u5b8cMysql+Apache+PHP\u540e\uff0c\u53d1\u73b0\u6709\u4e9b\u7f51\u9875\u6253\u5f00\u662f\u7a7a\u767d\u7684\u3002\u5c06php.ini\u91cc\u9762\u7684\u53c2\u6570 e<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"https:\/\/log.d9t3.com\/?p=25\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/log.d9t3.com\/index.php?rest_route=\/wp\/v2\/posts\/25"}],"collection":[{"href":"https:\/\/log.d9t3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/log.d9t3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/log.d9t3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/log.d9t3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":1,"href":"https:\/\/log.d9t3.com\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":26,"href":"https:\/\/log.d9t3.com\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions\/26"}],"wp:attachment":[{"href":"https:\/\/log.d9t3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/log.d9t3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/log.d9t3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}