流浪汉没有加载正确的版本

时间:2018-10-29 12:35:17

标签: php ansible vagrant

在我将ansible playbooks的php版本从5更新到7.2之后,并使用xdebug来匹配版本。 而我在无业游民的框中运行php -v我得到

  

PHP 7.2.11-3 + ubuntu14.04.1 + deb.sury.org + 1(CLI)(建立:2018年10月25日08:20:21)(NTS)   版权所有(c)1997-2018 The PHP Group   Zend Engine v3.2.0,版权所有(c)1998-2018 Zend Technologies       与Zend OPcache v7.2.11-3 + ubuntu14.04.1 + deb.sury.org + 1,版权所有(c)1999-2018,Zend Technologies       与Xdebug v2.6.1,版权(c)2002-2018,作者Derick Rethans

但是我的phpinfo();

  

PHP版本5.6.38-3 + ubuntu14.04.1 + deb.sury.org + 1此程序可以使   使用Zend脚本语言引擎:Zend Engine v2.6.0,   版权所有(c)1998-2016 Zend Technologies       与Zend OPcache v7.0.6-dev,Zend Technologies版权所有(c)1999-2016       Xdebug v2.5.5,版权所有(c)2002-2017,作者Derick Rethans

我的剧本

---

 name: Add ppa Repository
  sudo: yes
  apt_repository: repo=ppa:ondrej/{{ php.ppa }}

- name: Update apt
  sudo: yes
  apt: update_cache=yes

- name: Install php72
  sudo: yes
  apt: pkg=php7.2 state=latest

- name: Install php72-fpm
  sudo: yes
  apt: pkg=php5-fpm state=latest

- name: Install PHP Packages
  sudo: yes
  apt: pkg={{ item }} state=latest
  with_items: "{{php.packages}}"
  when: php.packages is defined

- name: Set date.timezone for CLI
  become: true
  lineinfile:
    dest: /etc/php/7.2/cli/php.ini
    regexp: "date.timezone ="
    line: "date.timezone = Europe/Berlin"

- name: Set date.timezone for apache php
  become: true
  lineinfile:
    dest: /etc/php/7.2/apache2/php.ini
    regexp: "date.timezone ="
    line: "date.timezone = Europe/Berlin"

- include: configure.yml
- include: pecl.yml

1 个答案:

答案 0 :(得分:1)

因此,进行php -v会告诉您您的php CLI正在运行哪个版本的php。因此,CLI和phpinfo中的版本冲突。其次,将任务“ Install php72-fpm”上的“ pkg”设置为“ php5-fpm”;尝试将其切换到所需的版本,然后查看操作方法。

相关问题