{"id":222,"date":"2012-07-04T00:45:20","date_gmt":"2012-07-03T16:45:20","guid":{"rendered":"http:\/\/blog.garphy.com\/?p=222"},"modified":"2012-07-04T00:45:20","modified_gmt":"2012-07-03T16:45:20","slug":"%e8%bd%acphp5-3-10%e7%9a%84%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/blog.garphy.com\/?p=222","title":{"rendered":"[\u8f6c]php5.3.10\u7684\u5b89\u88c5"},"content":{"rendered":"<p>php5.3.10\u7684\u5b89\u88c5<\/p>\n<p>\u4e0b\u9762\u4ee5\u6700\u65b0\u7684php-5.3.10\u4e3a\u4f8b\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p>wget http:\/\/cn.php.net\/distributions\/php-5.3.10.tar.gz<br \/>\ntar -zxvf php-5.3.10.tar.gz<br \/>\ncd php-5.3.10<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/php &#8211;with-config-file-path=\/usr\/local\/php\/etc &#8211;with-mysql=\/usr\/local\/mysql &#8211;with-mysqli=\/usr\/local\/mysql\/bin\/mysql_config &#8211;with-iconv-dir &#8211;with-freetype-dir &#8211;with-jpeg-dir &#8211;with-png-dir &#8211;with-zlib &#8211;with-libxml-dir &#8211;enable-xml &#8211;disable-rpath &#8211;enable-bcmath &#8211;enable-shmop &#8211;enable-sysvsem &#8211;enable-inline-optimization &#8211;with-curl &#8211;with-curlwrappers &#8211;enable-mbregex &#8211;enable-fpm &#8211;enable-mbstring &#8211;with-mcrypt &#8211;with-gd &#8211;enable-gd-native-ttf &#8211;with-openssl &#8211;with-mhash &#8211;enable-pcntl &#8211;enable-sockets &#8211;with-ldap &#8211;with-ldap-sasl &#8211;with-xmlrpc &#8211;enable-zip &#8211;enable-soap &#8211;enable-tidy &#8211;enable-json<\/p>\n<p>\u4e0a\u9762\u7684\u5177\u4f53\u53c2\u6570\u53ef\u4ee5\u4f7f\u7528.\/configure &#8211;help\u67e5\u770b<\/p>\n<p>make ZEND_EXTRA_LIBS=&#8217;-liconv&#8217;<br \/>\nmake test<br \/>\nmake &amp;&amp; make install\u00a0\u00a0 \uff08\u6b64\u5904\u6700\u597d\u5206\u5f00\u505a\uff0c\u56e0\u4e3amake\u7684\u65f6\u5019\u4f1a\u6709\u62a5\u9519\u51fa\u73b0\u3002\uff09<\/p>\n<p>\u6211\u5728\u4e0a\u9762\u7684make\u65f6\u5c31\u62a5\u4e86\u4e0b\u9762\u7684\u9519\u8bef<\/p>\n<p>root\/source\/php-5.3.10\/sapi\/cli\/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory<br \/>\nmake: *** [ext\/phar\/phar.php] Error 127<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\u662f\uff08\u6211\u7684mysql\u5b89\u88c5\u76ee\u5f55\u662f\/usr\/local\/msyql\uff0c\u8fd9\u4e2a\u89c6\u81ea\u5df1\u7684mysql\u5b89\u88c5\u8def\u5f84\u800c\u5b9a\u3002\uff09<br \/>\nln -s \/usr\/local\/mysql\/lib\/libmysqlclient.so.18\u00a0 \/usr\/lib\/<br \/>\n64\u4f4d\u7cfb\u7edf\u5e94\u4f7f\u7528\u4e0b\u9762\u7684\u8fd9\u884c<br \/>\nln -s \/usr\/local\/mysql\/lib\/libmysqlclient.so.18\u00a0 \/usr\/lib64\/<\/p>\n<p>cp php.ini-production \/usr\/local\/php\/etc\/php.ini<br \/>\ncp sapi\/fpm\/init.d.php-fpm \/etc\/init.d\/php-fpm<br \/>\ncp sapi\/fpm\/php-fpm.conf \/usr\/local\/php\/etc\/php-fpm.conf<\/p>\n<p>\u4fee\u6539php.ini\u6587\u4ef6\u548cphp-fpm\u6587\u4ef6\u4e2d\u53c2\u6570\uff0c\u53ef\u4ee5\u624b\u52a8\u66f4\u6539\u4e5f\u53ef\u4ee5\u7528\u4e0b\u9762\u7684sed\u547d\u4ee4\u66f4\u6539<\/p>\n<p>sed -i &#8216;s#short_open_tag = Off#short_open_tag = On#g&#8217; \/usr\/local\/php\/etc\/php.ini<br \/>\nsed -i &#8216;s#;pid = run\/php-fpm.pid#pid = run\/php-fpm.pid#g&#8217; \/usr\/local\/php\/etc\/php-fpm.conf<br \/>\nsed -i &#8216;s#pm.max_children = 5#pm.max_children = 32#g&#8217; \/usr\/local\/php\/etc\/php-fpm.conf<br \/>\nsed -i &#8216;s#pm.start_servers = 2#pm.start_servers = 16#g&#8217; \/usr\/local\/php\/etc\/php-fpm.conf<br \/>\nsed -i &#8216;s#pm.min_spare_servers = 1#pm.min_spare_servers = 8#g&#8217; \/usr\/local\/php\/etc\/php-fpm.conf<br \/>\nsed -i &#8216;s#pm.max_spare_servers = 3#pm.max_spare_servers = 32#g&#8217; \/usr\/local\/php\/etc\/php-fpm.conf<br \/>\nsed -i &#8216;s#;pm.max_requests = 500#pm.max_requests = 120#g&#8217; \/usr\/local\/php\/etc\/php-fpm.conf<\/p>\n<p>\u5173\u4e8ephp-fpm\u51e0\u4e2a\u91cd\u8981\u53c2\u6570\u7684\u8c03\u6574\u65b9\u9762\u5177\u4f53\u53ef\u4ee5\u53c2\u770b\u6211\u7684\u53e6\u4e00\u7bc7\u65e5\u5fd7\uff1ahttp:\/\/www.361way.com\/php-fpm\/890.html\u00a0 \u53e6\u5916php\u5b98\u65b9\u4e5f\u7ed9\u51fa\u4e86\u5176\u4e2d\u6240\u6709\u53c2\u6570\u9879\u7684\u89e3\u91ca\u8bf4\u660e\uff0c\u5177\u4f53\u89c1http:\/\/www.php.net\/manual\/en\/install.fpm.configuration.php<\/p>\n<p>\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8<\/p>\n<p>chmod 755 \/etc\/init.d\/php-fpm<br \/>\nchkconfig &#8211;add php-fpm<br \/>\n\/etc\/init.d\/php-fpm start<\/p>\n<p>\u81f3\u6b64\uff0cphp\u7684\u5b89\u88c5\u5b8c\u6bd5\u3002<\/p>\n<p>\u6700\u540e\u53ef\u4ee5\u518d\u5b89\u88c5\u4e00\u4e9bphp\u7684\u6269\u5c55\u5305\u548c\u5f00\u6237php\u52a0\u901f\uff08\u5177\u4f53\u8f6f\u4ef6\u5305\u53ef\u4ee5\u89c6\u7f51\u4e0a\u7684\u6700\u65b0\u7248\u8fdb\u884c\u5b89\u88c5\uff09\uff1a<\/p>\n<p>tar zxvf memcache-2.2.5.tgz<br \/>\ncd memcache-2.2.5\/<br \/>\n\/usr\/local\/php\/bin\/phpize<br \/>\n.\/configure &#8211;with-php-config=\/usr\/local\/php\/bin\/php-config<br \/>\nmake<br \/>\nmake install<br \/>\ncd ..\/<\/p>\n<p>tar jxvf eaccelerator-0.9.6.1.tar.bz2<br \/>\ncd eaccelerator-0.9.6.1\/<br \/>\n\/usr\/local\/php\/bin\/phpize<br \/>\n.\/configure &#8211;enable-eaccelerator=shared &#8211;with-php-config=\/usr\/local\/php\/bin\/php-config<br \/>\nmake<br \/>\nmake install<br \/>\ncd ..\/<\/p>\n<p>tar zxvf PDO_MYSQL-1.0.2.tgz<br \/>\ncd PDO_MYSQL-1.0.2\/<br \/>\n\/usr\/local\/php\/bin\/phpize<br \/>\n.\/configure &#8211;with-php-config=\/usr\/local\/php\/bin\/php-config &#8211;with-pdo-mysql=\/usr\/local\/mysql<br \/>\nmake<br \/>\nmake install<br \/>\ncd ..\/<\/p>\n<p>tar zxvf ImageMagick.tar.gz<br \/>\ncd ImageMagick-6.5.1-2\/<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<br \/>\ncd ..\/<\/p>\n<p>tar zxvf imagick-2.3.0.tgz<br \/>\ncd imagick-2.3.0\/<br \/>\n\/usr\/local\/php\/bin\/phpize<br \/>\n.\/configure &#8211;with-php-config=\/usr\/local\/php\/bin\/php-config<br \/>\nmake<br \/>\nmake install<br \/>\ncd ..\/<\/p>\n<p>\u4fee\u6539php.ini\u6587\u4ef6<br \/>\n\u624b\u5de5\u4fee\u6539\uff1a\u67e5\u627e\/usr\/local\/php\/etc\/php.ini\u4e2d\u7684extension_dir = &#8220;.\/&#8221;<br \/>\n\u4fee\u6539\u4e3aextension_dir = &#8220;\/usr\/local\/php\/lib\/php\/extensions\/no-debug-non-zts-20060613\/&#8221;<br \/>\n\u5e76\u5728\u6b64\u884c\u540e\u589e\u52a0\u4ee5\u4e0b\u51e0\u884c\uff0c\u7136\u540e\u4fdd\u5b58\uff1a<br \/>\nextension = &#8220;memcache.so&#8221;<br \/>\nextension = &#8220;pdo_mysql.so&#8221;<br \/>\nextension = &#8220;imagick.so&#8221;<\/p>\n<p>\u518d\u67e5\u627eoutput_buffering = Off<br \/>\n\u4fee\u6539\u4e3aoutput_buffering = On<\/p>\n<p>\u518d\u67e5\u627e; cgi.fix_pathinfo=0<br \/>\n\u4fee\u6539\u4e3acgi.fix_pathinfo=0\uff0c\u9632\u6b62Nginx\u6587\u4ef6\u7c7b\u578b\u9519\u8bef\u89e3\u6790\u6f0f\u6d1e\u3002<\/p>\n<p>\u914d\u7f6eeAccelerator\u52a0\u901fPHP\uff1a<br \/>\nmkdir -p \/opt\/webserver\/eaccelerator_cache<br \/>\nvi \/usr\/local\/php\/etc\/php.ini<\/p>\n<p>\u5728php.ini\u914d\u7f6e\u6587\u4ef6\u7684\u6700\u672b\u5c3e\uff0c\u52a0\u4e0a\u4ee5\u4e0b\u914d\u7f6e\u4fe1\u606f\uff1a<br \/>\n[eaccelerator]<br \/>\nzend_extension=&#8221;\/usr\/local\/php\/lib\/php\/extensions\/eaccelerator.so&#8221;<br \/>\neaccelerator.shm_size=&#8221;64&#8243;<br \/>\neaccelerator.cache_dir=&#8221;\/opt\/webserver\/eaccelerator_cache&#8221;<br \/>\neaccelerator.enable=&#8221;1&#8243;<br \/>\neaccelerator.optimizer=&#8221;1&#8243;<br \/>\neaccelerator.check_mtime=&#8221;1&#8243;<br \/>\neaccelerator.debug=&#8221;0&#8243;<br \/>\neaccelerator.filter=&#8221;&#8221;<br \/>\neaccelerator.shm_max=&#8221;0&#8243;<br \/>\neaccelerator.shm_ttl=&#8221;3600&#8243;<br \/>\neaccelerator.shm_prune_period=&#8221;3600&#8243;<br \/>\neaccelerator.shm_only=&#8221;0&#8243;<br \/>\neaccelerator.compress=&#8221;1&#8243;<br \/>\neaccelerator.compress_level=&#8221;9&#8243;<\/p>\n<p>php\u7684\u5b89\u5168\u6027\u8bbe\u7f6e\uff1a<\/p>\n<p>\u627e\u5230\uff1a;open_basedir =<br \/>\n\u4fee\u6539\u4e3a\uff1aopen_basedir = .:\/tmp\/\u00a0\u00a0 #\u9632\u6b62php\u6728\u9a6c\u8de8\u7ad9\uff0c\u91cd\u8981\uff01\uff01<br \/>\n\u627e\u5230\uff1adisable_functions =<br \/>\n\u4fee\u6539\u4e3a\uff1adisable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname<br \/>\n#\u5217\u51faPHP\u53ef\u4ee5\u7981\u7528\u7684\u51fd\u6570\uff0c\u5982\u679c\u67d0\u4e9b\u7a0b\u5e8f\u9700\u8981\u7528\u5230\u8fd9\u4e2a\u51fd\u6570\uff0c\u53ef\u4ee5\u5220\u9664\uff0c\u53d6\u6d88\u7981\u7528\u3002<br \/>\n\u627e\u5230\uff1a;date.timezone =<br \/>\n\u4fee\u6539\u4e3a\uff1adate.timezone = PRC<br \/>\n\u627e\u5230\uff1aexpose_php = On<br \/>\n\u4fee\u6539\u4e3a\uff1aexpose_php = OFF\u00a0 #\u7981\u6b62\u663e\u793aphp\u7248\u672c\u7684\u4fe1\u606f<br \/>\n\u627e\u5230\uff1adisplay_errors = On<br \/>\n\u4fee\u6539\u4e3a\uff1adisplay_errors = OFF\u00a0 #\u5173\u95ed\u9519\u8bef\u63d0\u793a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>php5.3.10\u7684\u5b89\u88c5 \u4e0b\u9762\u4ee5\u6700\u65b0\u7684php-5.3.10\u4e3a\u4f8b\u8fdb\u884c\u5b89\u88c5\u3002 wget http:\/\/cn.php &hellip; <a href=\"https:\/\/blog.garphy.com\/?p=222\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">[\u8f6c]php5.3.10\u7684\u5b89\u88c5<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[47,41],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-php"],"_links":{"self":[{"href":"https:\/\/blog.garphy.com\/index.php?rest_route=\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.garphy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.garphy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.garphy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.garphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=222"}],"version-history":[{"count":1,"href":"https:\/\/blog.garphy.com\/index.php?rest_route=\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/blog.garphy.com\/index.php?rest_route=\/wp\/v2\/posts\/222\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/blog.garphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.garphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.garphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}