利用ansible为php-fpm编译添加redis模块

---
- hosts: 10.0.0.171
  vars:
    redisver: phpredis-5.3.4
    redissrc: phpredis-5.3.4.tar.gz
    phpdir: /data/php
  tasks:
    - name: autoconf
      yum: name=autoconf
    - name: get php-redis  code
      unarchive: remote_src=no src={{redissrc}} dest=/usr/local/src
      register: var1
      until: var1 is succeeded
    - name: configure
      shell: |
         chdir=/usr/local/src/{{redisver}}
         {{phpdir}}/bin/phpize 
         ./configure --with-php-config={{phpdir}}/bin/php-config
         make 
         make install
         echo 'extension=redis.so' >> /etc/php.ini
    - name: restart php-fpm
      service: name=php-fpm state=restarted enabled=yes
上一篇:Centos7安装整合Apache+PHP,安装nginx后nginx无法解析.php文件


下一篇:Mac brew 启动和关闭php-fpm