Closed claystation closed 6 years ago
Yep, confirming the above ^^:
apt list --installed | grep php
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
php-apcu/xenial,now 5.1.9+4.0.11-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php-common/now 1:58+ubuntu16.04.1+deb.sury.org+1 all [installed,upgradable to: 1:59+ubuntu16.04.1+deb.sury.org+1]
php-igbinary/xenial,now 2.0.5-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php-memcached/xenial,now 3.0.4+2.2.0-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php-msgpack/xenial,now 2.0.2+0.5.7-1+ubuntu16.04.1+deb.sury.org+3 amd64 [installed]
php-yaml/xenial,now 2.0.2+1.3.1-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6/xenial,xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 all [installed]
php5.6-cli/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-common/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php5.6-curl/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-dev/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-fpm/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-gd/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-imap/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-json/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-mbstring/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-mcrypt/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-mysql/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-opcache/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-readline/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php5.6-sqlite3/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-xml/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php5.6-zip/xenial,now 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
php7.2-cli/xenial,now 7.2.1-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php7.2-common/xenial,now 7.2.1-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php7.2-json/xenial,now 7.2.1-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php7.2-opcache/xenial,now 7.2.1-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php7.2-phpdbg/xenial,now 7.2.1-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php7.2-readline/xenial,now 7.2.1-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
Same here with:
playbook.yml
- hosts: all
become: yes
vars_files:
- vars.yml
roles:
- geerlingguy.php-versions
- geerlingguy.php
vars.yml
php_install_from_source: false
php_version: "5.6"
php_packages_state: "latest"
php_packages_extra:
- libpcre3-dev
- "php{{ php_version }}-apcu"
- "php{{ php_version }}-common"
- "php{{ php_version }}-intl"
- "php{{ php_version }}-cli"
- "php{{ php_version }}-dev"
- "php{{ php_version }}-fpm"
- "php{{ php_version }}-gd"
- "php{{ php_version }}-curl"
- "php{{ php_version }}-imap"
- "php{{ php_version }}-json"
- "php{{ php_version }}-memcache"
- "php{{ php_version }}-memcached"
- "php{{ php_version }}-mcrypt"
- "php{{ php_version }}-opcache"
- "php{{ php_version }}-pdo"
- "php{{ php_version }}-xml"
- "php{{ php_version }}-zip"
- "php{{ php_version }}-mysql"
- "php{{ php_version }}-ssh2"
php_conf_paths:
- "/etc/php/{{ php_version }}/fpm"
- "/etc/php/{{ php_version }}/cli"
php_extension_conf_paths:
- "/etc/php/{{ php_version }}/fpm/conf.d"
- "/etc/php/{{ php_version }}/cli/conf.d"
php_date_timezone: "Europe/Paris"
php_display_errors: "On"
php_error_reporting: "E_ALL & ~E_DEPRECATED & ~E_STRICT"
php_webserver_daemon: "nginx"
php_enable_php_fpm: true
php_fpm_daemon: "php{{ php_version }}-fpm"
php_fpm_conf_path: "/etc/php/{{ php_version }}/fpm"
php_fpm_pool_conf_path: "{{ php_fpm_conf_path }}/pool.d/www.conf"
An easy quick fix for me was to call 'php-versions' role after 'php' role:
playbook.yml
- hosts: all
become: yes
vars_files:
- vars.yml
roles:
- geerlingguy.php
- geerlingguy.php-versions
That seems weird but with that order, the php binaries purge will come after php extension installations
I haven't had this issue, but I always have the php-versions role before the php role. Tested with a few different installs on CentOS and Debian and can't replicate :/
Ah, but yes, if you install any package without an explicit version (e.g. php-apcu
), then everything kind of blows up because of the way Debian OSes do PHP versioned packages (at least the most standard way)... I know apcu and maybe one or two other packages will default to making the systemwide PHP install whatever is latest on that OS, at least I think.
Ah, but yes, if you install any package without an explicit version (e.g. php-apcu), then everything kind of blows up because of the way Debian OSes do PHP versioned packages (at least the most standard way)...
But i specified the version? See in my initial report:
vagrant@contrib-jessie:~$ sudo apt install php5.6-apcu
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php-apcu' instead of 'php5.6-apcu'
The following extra packages will be installed:
libargon2-0 libsodium18 php-apcu-bc php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-phpdbg php7.2-readline
Suggested packages:
php-gd php-pear
The following NEW packages will be installed:
libargon2-0 libsodium18 php-apcu php-apcu-bc php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-phpdbg php7.2-readline
0 upgraded, 10 newly installed, 0 to remove and 3 not upgraded.
Need to get 3721 kB of archives.
After this operation, 16.8 MB of additional disk space will be used.
I specified php5.6-acpu
, but it does not exists. So it will install php-acpu
which is latest (7.2).
See upstream issue: https://github.com/oerdnj/deb.sury.org/issues/563 — basically, quick fix is setting php_install_recommends: no
in your playbook.
I'm also going to patch this role to set that explicitly to avoid this problem by default (noticed that PHP 7.2 was installed on my test Ubuntu 16.04 box when I was doing some testing tonight).
I was trying to install php 5.6 in a Vagrant
debian/contrib-jessie64
machine. I set the variable to5.6
in thedefaults/main.yml
in the php-versions role. This sets all the correct variables. But when install with the rolephp
i still got php 7.2. I did some debugging (ansible -v
) and found this:As you can see, there are still PHP 7.2 packages installed altough ansible only passes PHP 5.6 packages to the installer. I ran only the
php-versions
role and went on installing the PHP packages one by one. I found out thephp-apcu
package is the problem. Manually running APT will give you this:I have not tested this on any other platform, maybe it is only Debian. Should the
php5.6-apcu
be removed from the list? It does not seem to exist anymore. I could submit a pull, but i rather ask for advice first.Playbook:
Vagrantfile:
Host OS: Fedora 27 Guest OS: Debian Jessie