{"id":2746,"date":"2012-04-20T13:45:00","date_gmt":"2012-04-20T05:45:00","guid":{"rendered":"http:\/\/www.orczhou.com\/?p=2746"},"modified":"2012-11-03T23:24:46","modified_gmt":"2012-11-03T15:24:46","slug":"how-to-make-install-php-module","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2012\/04\/how-to-make-install-php-module\/","title":{"rendered":"\u5982\u4f55\u7f16\u8bd1\u5b89\u88c5\u4e00\u4e2aphp\u6a21\u5757"},"content":{"rendered":"<p>\u4e0d\u6b62\u4e00\u6b21\u9700\u8981\u8fd9\u4e48\u505a\u4e86\u3002<\/p>\n<p>\u5982\u679c\u4f60\u9700\u8981\u7684\u6269\u5c55\u5728yum\/apt\u4ed3\u5e93\u4e2d\u6ca1\u6709\u7684\u8bdd\uff0c\u90a3\u9700\u8981\u81ea\u5df1\u7f16\u8bd1\u4e86\u3002<\/p>\n<div class=\"myt1\">1. \u4e0b\u8f7d<a href=\"http:\/\/www.php.net\/releases\/\">PHP5.2.9\u7684\u6e90\u4ee3\u7801<\/a>(\u6839\u636e\u4f60php\u7684\u7248\u672c\u9009\u62e9)<\/div>\n<div class=\"myt1\">2. \u7f16\u8bd1\u6a21\u5757<\/div>\n<p>\u8fdb\u5165\u5bf9\u5e94\u6a21\u5757\u7684\u6e90\u7801\u76ee\u5f55\uff0c\u7136\u540e\uff1aphpize\u3001configure\u3001make<\/p>\n<pre><div class=\"mycode\">$tar zxvf tar zxvf php-5.2.9.tar.gz\r\n$cd php-5.2.9\/ext\/curl\r\n$phpize\r\n  Configuring for:\r\n  PHP Api Version:         20041225\r\n  Zend Module Api No:      20060613\r\n  Zend Extension Api No:   220060519\r\n$.\/configure --with-php-config=\/opt\/php\/bin\/php-config\r\n  checking for egrep... grep -E\r\n  checking for a sed that does not truncate output... \/bin\/sed\r\n  ......\r\n  configure: creating .\/config.status\r\n  config.status: creating config.h\r\n$make\r\n  ......\r\n  Build complete.\r\n  Don't forget to run 'make test'.\r\n<\/div><\/pre>\n<div class=\"myt1\">3.\u5c06\u6269\u5c55\u6587\u4ef6(.so)cp\u5230php\u7684\u6269\u5c55\u76ee\u5f55<\/div>\n<p>\u6269\u5c55\u76ee\u5f55\u7684\u4f4d\u7f6e\u53ef\u4ee5\u901a\u8fc7phpinfo\u7684\u8f93\u51fa\u7ed3\u679c\u770b\u5230\uff0c\u4e5f\u53ef\u4ee5\u5728php.ini\u6587\u4ef6\u4e2d\u770b\u5230\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<div class=\"mycode\">cp modules\/sockets.so \/home\/admin\/php\/ext\/<\/div>\n<p>\u7136\u540e\u7f16\u8f91php.ini\u6587\u4ef6<\/p>\n<div class=\"mycode\">\n; extension_dir directive above.<br \/>\nextension_dir = &#8220;\/home\/admin\/php\/ext\/&#8221;<br \/>\nextension=memcache.so<br \/>\nextension=curl.so<br \/>\nextension=rrdtool.so<br \/>\nextension=oci8.so<br \/>\nextension=sockets.so\n<\/div>\n<div class=\"myt1\">4. \u91cd\u542f\u4f60\u7684apache\uff0cJob done<\/div>\n<p>\u53ef\u4ee5\u901a\u8fc7phpinfo()\u6765\u7684\u8f93\u51fa\u6765\u67e5\u770b\u662f\u5426\u6210\u529f\u5b89\u88c5\u5bf9\u5e94\u7684\u6a21\u5757\u3002<\/p>\n<p>\u53c2\u8003\uff1a<a href=\"http:\/\/php.net\/manual\/en\/install.pecl.phpize.php\">Compiling shared PECL extensions with phpize<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0d\u6b62\u4e00\u6b21\u9700\u8981\u8fd9\u4e48\u505a\u4e86\u3002 \u5982\u679c\u4f60\u9700\u8981\u7684\u6269\u5c55\u5728yum\/apt\u4ed3\u5e93\u4e2d\u6ca1\u6709\u7684\u8bdd\uff0c\u90a3\u9700\u8981\u81ea\u5df1\u7f16\u8bd1\u4e86\u3002 1. \u4e0b\u8f7dPHP5.2.9\u7684\u6e90\u4ee3\u7801(\u6839\u636e\u4f60php\u7684\u7248\u672c\u9009\u62e9) 2. \u7f16\u8bd1\u6a21\u5757 \u8fdb\u5165\u5bf9\u5e94\u6a21\u5757\u7684\u6e90\u7801\u76ee\u5f55\uff0c\u7136\u540e\uff1aphpize\u3001configure\u3001make $tar zxvf tar zxvf php-5.2.9.tar.gz $cd php-5.2.9\/ext\/curl $phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 $.\/configure &#8211;with-php-config=\/opt\/php\/bin\/php-config checking for egrep&#8230; grep -E checking for a sed that does not truncate output&#8230; \/bin\/sed &#8230;&#8230; configure: creating .\/config.status config.status: creating config.h [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[5],"tags":[95,94,119],"class_list":["post-2746","post","type-post","status-publish","format-standard","hentry","category-code-staff","tag-extension","tag-lamp","tag-php"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=2746"}],"version-history":[{"count":16,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2746\/revisions"}],"predecessor-version":[{"id":3934,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2746\/revisions\/3934"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=2746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=2746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=2746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}