首页 > nginx > php-fpm with php-5.3.2 + APC

php-fpm with php-5.3.2 + APC

2010年5月17日 eric 发表评论 阅读评论

php-fpm 现在php官方内部已经出版本了,据说以后会出现在 php core 里,如果现在安装的话,可以svn得到最新代码,我抢先为快。

至于缓存,我用的facebook 试用的apc 测试了一段时间还很,满意。

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.02.tar.bz2

wget http://monkey.org/~provos/libevent-1.4.13-stable.tar.gz

wget http://pecl.php.net/get/APC-3.1.3p1.tgz
tar zxvf pcre-8.02.tar.bz2

cd pcre-8.02

./configure --enable-utf8 --enable-pcregrep-libbz2

make

make install

tar zxvf libevent-1.4.13-stable.tar.gz

cd libevent-1.4.13-stable

./configure --prefix=/usr

make 

make install 
tar jxvf php-5.3.2.tar.bz2

cd php-5.3.2

svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm sapi/fpm

./buildconf --force

./configure --prefix=/usr/local/php --enable-fpm --disable-debug --disable-safe-mode --disable-ipv6 --enable-ftp --enable-zip --with-libevent-dir --with-fpm-user=www --with-fpm-group=www --with-config-file-path=/usr/local/php/etc --with-libxml-dir --with-openssl --with-pcre-regex --with-zlib --with-zlib-dir --with-bz2 --with-curl --with-libxml-dir --with-pcre-dir --with-openssl-dir --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --with-gettext --with-mhash --with-ldap --with-ldap-sasl --with-mcrypt --with-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-zlib-dir --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib-dir --with-openssl-dir --with-libxml-dir --with-libxml-dir --with-libxml-dir --with-iconv-dir=/usr/local --with-pear

make ZEND_EXTRA_LIBS='-liconv'

make install

cp php.ini-production /usr/local/php/etc/php.ini

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod 755 /etc/init.d/php-fpm

安装额外的 插件

tar zxvf APC-3.1.3p1.tgz

cd APC-3.1.3p1

./configure --enable-apc --enable-mmap --with-php-config=/usr/local/php/bin/php-config

make

make install

tar zxvf memcache-2.2.5.tgz

cd memcache-2.2.5

./configure --with-php-config=/usr/local/php/bin/php-config

make 

make install 
cd /usr/local/php/etc

mkdir fpm.d

vim php.ini
把 extension_dir = "./" 改为

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
extension = "memcache.so"
;因为最新版本的 apc 是不需要加任何参数,默认就是启动的
extension = "apc.so"

mv php-fpm.conf  php-fpm.conf.bak 
cat php-fpm.conf
;
; Global
;
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 5s
daemonize = yes
;pools here
include = /usr/local/php/etc/fpm.d/*.conf 
cd fpm.d
cat eric_blog.conf
;
; eric's blog pool
;
[blog]
listen = 127.0.0.1:9000
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
;listen.owner = www
;listen.group = www
;listen.mode = 0666
user = www
group = www
; 有两种形式,static , dynamic  默认是以dynamic。
pm = static
pm.max_children = 50
;pm.start_servers = 20
;pm.min_spare_servers = 5
;pm.max_spare_servers = 35
pm.max_requests = 65535
;pm.status_path = /status
;ping.path = /ping
;ping.response = pong
request_terminate_timeout = 0s
request_slowlog_timeout = 0s
slowlog = /usr/local/php/var/log/php-fpm.log.slow
rlimit_files = 65535
rlimit_core = 0
catch_workers_output = yes
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f
php_flag[display_errors] = off
php_admin_value[error_log] = /usr/local/php/var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 20M
php_admin_value[open_basedir] = /var/www/wordpress:/home/www/sessions:/tmp
php_admin_value[session.save_path] = /home/www/sessions

Php 官方出的 php-fpm 配置文件抛弃了 xml格式,采用 php.ini 格式式样,但是基本的配置是没有变的·其他 nginx  以及 mysql 的安装我就不写了。

创建一个 phpinfo(); 看一下

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/148.html

分类: nginx 标签: , , ,
  1. 2017年11月8日02:55 | #1

    Viagra Soft Tablets Homoopathie Levitra viagra Alli Canada Purchase Viagra Pe Can You Buy Valtrex In Mexico

  2. 2017年11月11日11:29 | #2

    To defend your family from danger?

  3. 2017年11月11日15:21 | #3

    Have you ever thought about adding a little bit more than just
    your articles? I mean, what you say is valuable and all. Nevertheless think about if you added some great graphics or video clips to give your posts more, “pop”!
    Your content is excellent but with pics and videos,
    this website could definitely be one of the best in its niche.
    Wonderful blog!

  4. 2017年11月11日17:31 | #4

    Hey there! Someone in my Myspace group shared this site with us so I came to take a look.

    I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to my followers!

    Wonderful blog and outstanding design and style.

  5. 2017年11月12日09:02 | #5

    To keep your valuables in complete safety?

  6. 2017年11月13日03:37 | #6

    It’s remarkable to visit this site and reading the views of all friends regarding this paragraph,
    while I am also zealous of getting know-how.

  7. 2017年11月13日10:38 | #7

    Greetings! Very helpful advice in this particular post!
    It is the little changes that make the most significant changes.

    Many thanks for sharing!

  8. 2017年11月15日00:21 | #8

    I’m amazed, I must say. Rarely do I encounter a blog that’s both equally educative and interesting,
    and let me tell you, you have hit the nail on the head.
    The issue is an issue that not enough people are speaking intelligently about.
    I’m very happy I stumbled across this in my search for
    something regarding this.

  9. 2017年11月20日15:50 | #9

    Your style is really unique compared to other people I have read stuff from.
    I appreciate you for posting when you have the opportunity, Guess I will just book mark
    this page.

  10. 2017年11月22日01:11 | #10

    Best Price 100mg Viagra Interaction Amoxicillin Methocarbam online pharmacy Ginette 35 No Rx Buy Baclofene Amm 2012

  11. 2017年11月22日22:34 | #11

    Discount cheapeast isotretinoin purchase in internet overseas pharmacy cheap cialis Beipackzettel Viagra Online Cialis Ohne Rezept Hamburg Cialis 10 Mg Filmtabletten Preisvergleich

  12. 2017年12月1日16:15 | #12

    Hi, just wanted to tell you, I liked this article. It was inspiring.

    Keep on posting!

  13. 2017年12月14日09:33 | #13

    After I initially left a comment I seem to have clicked the -Notify
    me when new comments are added- checkbox and from now on each time a comment is added I receive four emails with the same comment.
    There has to be an easy method you can remove me from that service?

    Thanks!

  14. 2017年12月26日20:29 | #14

    casino online usa
    online casino real money
    online casino
    online casino games
    online casino real money

  15. 2017年12月29日17:08 | #15

    casino online
    real money casino
    real money casino
    real money casino
    free casino games

  16. 2018年1月2日20:16 | #16

    michigan gambling casinos
    casino online
    best us gambling websites

  17. 2018年1月3日20:10 | #17

    loans for bad credit
    payday loans online no credit check
    loans online
    loans no credit check
    payday loans online

  18. 2018年1月5日09:41 | #18

    Just desire to say your article is as astounding. The clearness on your post is simply excellent and i can assume you are knowledgeable on this
    subject. Well together with your permission let me to snatch your RSS feed to
    keep updated with forthcoming post. Thank you 1,000,000 and please keep up the enjoyable work.

  19. 2018年1月7日14:21 | #19

    free casino slots
    free casino games slots
    free casino games
    free casino games no download
    free slot games

  20. 2018年1月14日14:04 | #20

    payday loans no credit check
    loans no credit check
    loans no credit check
    loans for bad credit
    payday loans online no credit check

  21. 2018年1月18日21:05 | #21

    456 free slots casino
    casinos in west virginia
    game slots
    casino slot games to play for free
    real money online

  22. 2018年1月21日00:23 | #22

    Hi there, just became aware of your blog through Google, and found that it’s really informative.

    I am gonna watch out for brussels. I will be
    grateful if you continue this in future. Numerous people will be
    benefited from your writing. Cheers!

  23. 2018年1月21日13:54 | #23

    payday loans online
    payday loans
    payday loans
    payday loans
    payday loans online

评论分页
1 2 3 4 148
订阅评论
1+4= (必填)