1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| #php_server install
- hosts: 172.16.1.5 根据自己主机自行定义
tasks:
-name: yum rely on
yum:name=zlib-devel,libxml2-devel,libjpeg-devel,libjpeg-turbo-devel,freetype-devel,libpng-devel,gd-devel,libcurl-devel,libxslt-devel
-name: installlibiconv
shell: cd /home/tools &&wget http://219.239.26.3/files/524500 ... ibiconv-1.14.tar.gz
-name: decompression libiconv
shell: cd /home/tools &&tar -xf libiconv-1.14.tar.gz
-name: Toconfigure libiconv
shell: cd /home/tools/libiconv-1.14 && ./configure --prefix=/usr/local/libiconv && make && make install
- name:epel
shell: wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
-name: yumlibmcrypt-devel
yum: name=libmcrypt-devel,mhash,mcrypt
- name: downloadphp-5.3.27
shell: cd /home/tools/ && wget http://php.net/get/php-5.3.27.tar.gz/from/a/mirror
-name: install php
shell: cd /home/tools/ &&tar -xf php-5.3.27.tar.gz
-name: softconnect
shell: ln -s/application/mysql/lib/libmysqlclient.so.18 /usr/lib64/
-name: createphar.phar
shell: touch /home/tools/php-5.3.27/ext/phar/phar.phar
-name: intophp-5.3.27
shell: cd /home/tools/php-5.3.27 && ./configure --prefix=/application/php5.3.27--with-mysql=/application/mysql --with-iconv-dir=/usr/local/libiconv--with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib--with-libxml-dir=/usr --enable-xml --disable-rpath --enable-safe-mode--enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization--with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring--with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl--enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags--enable-zend-multibyte --enable-static --with-xsl --with-fpm-user=nginx--with-fpm-group=nginx --enable-ftp && make && make install
- name: Soft connection php5.3.27
shell: ln -s /application/php5.3 27 /application/php
-name: copyphp.ini-production
shell: cp /home/tools/php-5.3.27/php.ini-production/application/php/lib/php.ini
-name: into/application/php/etc/
shell: cp /application/php/etc/php-fpm.conf.default/application/php/etc/php-fpm.conf
-name: into/home/tools/php-5.3.27
shell: cp/home/tools/php-5.3.27/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-name: Add executeauthority
shell: chmod +x /etc/init.d/php-fpm
-name: startphp-fpm
shell: /etc/init.d/php-fpm start
|