{"id":2084,"date":"2011-11-14T17:34:41","date_gmt":"2011-11-14T09:34:41","guid":{"rendered":"http:\/\/www.jpuyy.com\/blog\/?p=2084"},"modified":"2012-09-30T10:33:06","modified_gmt":"2012-09-30T02:33:06","slug":"php5-eaccelerator","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=2084","title":{"rendered":"\u5b89\u88c5php5\u6269\u5c55\u6a21\u5757eaccelerator"},"content":{"rendered":"<p>\u9996\u5148\u4e0b\u8f7deaccelerator\u6700\u65b0\u7248<\/p>\n<pre>wget http:\/\/sourceforge.net\/projects\/eaccelerator\/files\/eaccelerator\/eAccelerator%200.9.6.1\/eaccelerator-0.9.6.1.tar.bz2<\/pre>\n<p>\u7f51\u4e0a\u7684\u6559\u7a0b\u8bf4\u8981\u6709\/usr\/local\/php\/bin\/phpize\uff0c\u4f46\u662f\u6211\u7684vps\u4e0a\u7684php\u662fapt-get\u7684\u6ca1\u6709\u600e\u4e48\u529e\uff1f<\/p>\n<p>\u641c\u7d22\u5f97\u77e5\u8981\u5b89\u88c5php5-dev\u624d\u4f1a\u6709phpize\uff0c\u8fd8\u8981\u5b89\u88c5autoconf,automake<\/p>\n<pre>apt-get install php5-dev autoconf automake<\/pre>\n<p>\u5b89\u88c5\u5230\u6700\u540e\u63d0\u793a\u4e86<\/p>\n<pre>update-alternatives: using \/usr\/bin\/php-config5 to provide \/usr\/bin\/php-config (php-config) in auto mode.\r\nupdate-alternatives: using \/usr\/bin\/phpize5 to provide \/usr\/bin\/phpize (phpize) in auto mode.<\/pre>\n<p>\u65e2\u7136\u7ed9\u4e86\u4e0a\u9762\u7684\u63d0\u793a\uff0c\u5c31\u7528\u5e265\u7684<\/p>\n<p>\u51c6\u5907\u5de5\u4f5c\u5dee\u4e0d\u591a\u4e86\u5f00\u59cb\u5b89\u88c5<\/p>\n<pre>tar jxvf eaccelerator-0.9.6.1.tar.bz2\r\ncd eaccelerator-0.9.6.1\r\n\/usr\/bin\/phpize5\r\n.\/configure --enable-eaccelerator=shared --with-php-config=\/usr\/bin\/php-config5\r\nmake\r\nmake install<\/pre>\n<p>\u63d0\u793a\u8bf4 Installing shared extensions:\u00a0\u00a0\u00a0\u00a0 \/usr\/lib\/php5\/20090626+lfs\/<\/p>\n<p>\u8fd9\u6837\u521b\u5efa\u7f13\u5b58\u76ee\u5f55<\/p>\n<pre>mkdir \/tmp\/eaccelerator\r\nchmod 777 \/tmp\/eaccelerator<\/pre>\n<p>\u8fd9\u65f6\u7f16\u8f91\/etc\/php5\/fpm\/php.ini\u5728\u6700\u540e\u52a0\u5165\u5982\u4e0b\u4ee3\u7801<\/p>\n<p>\u914d\u7f6e\u9879\u66f4\u5177\u4f53\u51c6\u786e\u7684\u542b\u4e49\u6765\u81ea\uff1a<a href=\"https:\/\/eaccelerator.net\/wiki\/Settings\">https:\/\/eaccelerator.net\/wiki\/Settings<\/a><\/p>\n<pre>vim \/etc\/php5\/fpm\/php.ini<\/pre>\n<pre>[eaccelerator]\r\nzend_extension=\"\/usr\/lib\/php5\/20090626+lfs\/eaccelerator.so\"\r\neaccelerator.shm_size=\"32\"\r\neaccelerator.cache_dir=\"\/tmp\/eaccelerator\"\r\neaccelerator.enable=\"1\"\r\neaccelerator.optimizer=\"1\"\r\neaccelerator.check_mtime=\"1\"\r\neaccelerator.debug=\"0\"\r\neaccelerator.filter=\"\"\r\neaccelerator.shm_max=\"0\"\r\neaccelerator.shm_ttl=\"300\"\r\neaccelerator.shm_prune_period=\"120\"\r\neaccelerator.shm_only=\"0\"\r\neaccelerator.compress=\"1\"\r\neaccelerator.compress_level=\"9\"<\/pre>\n<p>\u91cd\u542f\u4e0bphp5-fpm<\/p>\n<pre>\/etc\/init.d\/php5-fpm restart<\/pre>\n<p>\u5982\u4f55\u68c0\u6d4b\u5462\uff0c\u641e\u4e00\u4e2aphpinfo();<\/p>\n<p>\u6709<a name=\"module_eAccelerator\"><\/a>eAccelerator \u8fd9\u4e00\u8282\u7684\u63cf\u8ff0<\/p>\n<p>\u8fd9\u65f6\u8fdb\u5230\/tmp\/eaccelerator\u4f1a\u53d1\u73b0\u6709\u4e0d\u5c11\u7684\u76ee\u5f55<\/p>\n<p>\u6536\u83b7\uff1a<\/p>\n<p>\u6709\u7a7a\u7684\u8bdd\u8fd8\u662f\u8981\u4e0d\u6015\u9ebb\u70e6\u7f16\u8bd1\u5b89\u88c5\uff0c\u8fd9\u6837\u5bf9\u7a0b\u5e8f\u4f1a\u66f4\u719f\u6089<\/p>\n<p>\u4e0d\u8981\u4ece\u4e0d\u9760\u8c31\u7684\u7f51\u4e0a\u76f4\u63a5\u590d\u5236\u914d\u7f6e\u6587\u4ef6\uff0c\u590d\u5236\u8fc7\u6765\u7684\u53cc\u5f15\u53f7\u5168\u662f\u4e2d\u6587\u7684<\/p>\n<p>\u7eed\uff1a<\/p>\n<p>\u6309wiki\u91cc\u9762\u8bf4\u7684\u6211\u67e5\u770b\u4e86\u4e0b\u6700\u5927\u5171\u4eab\u5927\u5c0f<\/p>\n<pre>cat \/proc\/sys\/kernel\/shmmax<\/pre>\n<p>\u5f97\u523033554432<\/p>\n<p>\u7528expr\u9664\u4e86\u4e24\u6b21\uff1a<\/p>\n<pre>expr 33554432 \\\/ 1024\r\n 32768\r\n expr 32768 \\\/ 1024\r\n 32<\/pre>\n<p>\u800c\u8fd9\u6837\u6309\u914d\u7f6e\u8bbe\u7f6e64\uff0cphp5-fpm\u5c31\u4e0d\u80fd\u91cd\u542f\u6210\u529f<\/p>\n<p>\u6bd4\u5982\u60f3\u5f04\u621064\uff0c\u5219<\/p>\n<p>echo 67108864 &gt; \/proc\/sys\/kernel\/shmmax<\/p>\n<p>\u6548\u679c\u5982\u4f55\uff1f<\/p>\n<p>\u4e0d\u4f1a\u6d4b\u8bd5\uff0c\u7f51\u4e0a\u4eba\u8bf4\u7684\u662fea\u7684\u4f5c\u7528\u5c31\u662f\u8ba9\u7f13\u5b58\u91ccphp\u6587\u4ef6\u4e0d\u9700\u8981\u518d\u6b21\u7f16\u8bd1\uff0c\u8fd9\u4e00\u70b9\u6211\u89c9\u5f97\u6709\u53ef\u80fd\u5427<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u4e0b\u8f7deaccelerator\u6700\u65b0\u7248 wget http:\/\/sourceforge.net\/projects\/eaccelerator\/files\/eaccelerator\/eAccelerator%200.9.6.1\/eaccelerator-0.9.6.1.tar.bz2 \u7f51\u4e0a\u7684\u6559\u7a0b\u8bf4\u8981\u6709\/usr\/local\/php\/bin\/phpize\uff0c\u4f46\u662f\u6211\u7684vps\u4e0a\u7684php\u662fapt-get\u7684\u6ca1\u6709\u600e\u4e48\u529e\uff1f \u641c\u7d22\u5f97\u77e5\u8981\u5b89\u88c5php5-dev\u624d\u4f1a\u6709phpize\uff0c\u8fd8\u8981\u5b89\u88c5autoconf,automake apt-get install php5-dev autoconf automake \u5b89\u88c5\u5230\u6700\u540e\u63d0\u793a\u4e86 update-alternatives: using \/usr\/bin\/php-config5 to provide \/usr\/bin\/php-config (php-config) in auto mode. update-alternatives: using \/usr\/bin\/phpize5 to provide \/usr\/bin\/phpize (phpize) in auto mode. \u65e2\u7136\u7ed9\u4e86\u4e0a\u9762\u7684\u63d0\u793a\uff0c\u5c31\u7528\u5e265\u7684 \u51c6\u5907\u5de5\u4f5c\u5dee\u4e0d\u591a\u4e86\u5f00\u59cb\u5b89\u88c5 tar jxvf eaccelerator-0.9.6.1.tar.bz2 cd eaccelerator-0.9.6.1 \/usr\/bin\/phpize5 .\/configure &#8211;enable-eaccelerator=shared &#8211;with-php-config=\/usr\/bin\/php-config5 make make install \u63d0\u793a\u8bf4 Installing shared extensions:\u00a0\u00a0\u00a0\u00a0 \/usr\/lib\/php5\/20090626+lfs\/ \u8fd9\u6837\u521b\u5efa\u7f13\u5b58\u76ee\u5f55 mkdir \/tmp\/eaccelerator chmod 777 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2084","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2084"}],"version-history":[{"count":21,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2084\/revisions"}],"predecessor-version":[{"id":2086,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2084\/revisions\/2086"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}