【发布时间】:2019-04-02 09:25:16
【问题描述】:
在我将我的 ansible playbooks php 版本从 5 更新到 7.2 和 xdebug 以匹配该版本之后。 我在我的 vagrant box 中运行 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 PHP 集团 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,版权所有 (c) 1999-2016,Zend Technologies 使用 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
【问题讨论】:
-
检查两个 phpinfos 中的 php 路径,或者输入哪个 php 来找到正在使用的那个#