zoukankan      html  css  js  c++  java
  • 使用Ansible安装部署nginx+php+mysql之安装php(2)

    二、使用Ansible安装php

    1、php.yaml文件内容

     1 - hosts: clong
     2   remote_user: root
     3   gather_facts: no
     4   tasks:
     5     # 安装libselinux-python
     6     - name: isntall libselinux-python
     7       yum: name=libselinux-python state=present
     8     # 安装epel源 
     9     - name: install epel-release repo
    10       yum: name=epel-release state=present
    11     # 安装rpm包
    12     - name: install remote php rpm
    13       yum: name=http://rpms.famillecollet.com/enterprise/remi-release-7.rpm state=present
    14     # 安装php5.6  
    15     - name: install php
    16       yum: name={{ item }} state=present enablerepo=remi enablerepo=remi-php56
    17       with_items:
    18        - php 
    19        - php-opcache 
    20        - php-devel 
    21        - php-mbstring 
    22        - php-mcrypt 
    23        - php-mysqlnd 
    24        - php-phpunit-PHPUnit 
    25        - php-pecl-xdebug 
    26        - php-pecl-xhprof
    27        - php-mysql 
    28        - php-pecl-apcu 
    29        - php-pdo 
    30        - php-pear 
    31        - php-fpm 
    32        - php-cli 
    33        - php-xml 
    34        - php-bcmath 
    35        - php-process 
    36        - php-gd 
    37        - php-common
    38        - php-json  
    39        - php-pdo_dblib 
    40        - php-pgsql 
    41        - php-recode 
    42        - php-snmp 
    43        - php-soap 
    44        - php-pecl-zip 
    45        - libjpeg* 
    46        - php-imap 
    47        - php-ldap 
    48        - php-odbc 
    49        - php-xmlrpc 
    50        - php-mbstring  
    51        - php-bcmath 
    52        - php-mhash 
    53        - libmcrypt 
    54        - libmcrypt-devel
    55     # 开启php-fpm
    56     - name: start php-fpm
    57       service: name=php-fpm state=started enabled=yes
    58     # 复制index.php文件到网站根目录
    59     - name: copy index.php
    60       copy: src=index.php dest=/usr/share/nginx/html/index.php
    61       notify: restart nginx
    62     # 重启nginx
    63   handlers:
    64     - name: restart nginx
    65       service: name=nginx state=restarted

    2、index.php文件

    1 <?php
    2     echo phpinfo();
    3 ?>    

     注:安装的php版本查看

    #php -v

    PHP 5.6.31 (cli) (built: Jul  6 2017 08:06:11)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
        with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

  • 相关阅读:
    WEB手机端界面绝对定位分辨率扩大导致错乱问题和块级元素旋转角度CSS
    8.1 设置滑动效果和多媒体
    2.4 链接文字属性和标记元素
    2.3元信息标记 meta
    记录这几天工作内容发现的兼容性问题
    WEB前端开发工程师成长之路(计划)
    IE兼容CSS3圆角border-radius的方法
    Quirks模式是什么?
    让所有浏览器包括IE6即支持最大宽度又支持最小宽度。
    ie6下png背景显示问题?
  • 原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/7273303.html
Copyright © 2011-2022 走看看