# Ansible (Problem install PHP)

**URL:** <https://forum.ansible.com/t/ansible-problem-install-php/25891>\
**Category:** Ansible Project\
**Created:** [November 1, 2017, 7:37pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891 "2017-11-01T19:37:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artur001](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Artur001](https://forum.ansible.com/u/Artur001)\
**Post date:** [November 1, 2017, 7:37pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/1 "2017-11-01T19:37:21Z")

</div>

My main.yml

`  
Введи- name: add php ppa  
apt\_repository: repo=‘ppa:ondrej/php’ state=present

- name: update apt cache  
apt: update\_cache=yes

- name: install php requirements for joomla  
apt: name=php{{ php.version }}-{{ item }} state=present  
with\_items:

- json

- xml

- mbstring

- intl

- apcache

- mysql

- pgsql те код…  
`

`Введите код.TASK [php : install php requirements for joomla] ******************************* failed: [joomla] (item=[u'php7.1-json', u'php7.1-xml', u'php7.1-mbstring', u'php7.1-intl', u'php7.1-apcache', u'php7.1-mysql', u'php7.1-pgsql']) => {"changed": false, "failed": true, "item": ["php7.1-json", "php7.1-xml", "php7.1-mbstring", "php7.1-intl", "php7.1-apcache", "php7.1-mysql", "php7.1-pgsql"], "msg": "No package matching 'php7.1-apcache' is available"} to retry, use: --limit @/home/artur/php-joomla-vm/provisioning/playbook.retry ..`

What is it problem?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 1, 2017, 8:02pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/2 "2017-11-01T20:02:00Z")

</div>

its apache not apcache

---

<div class="post-metadata">

**Author:** ![Artur001](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Artur001](https://forum.ansible.com/u/Artur001)\
**Post date:** [November 2, 2017, 7:42am UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/3 "2017-11-02T07:42:42Z")

</div>

Thank you.  
But problem stays.

`TASK [php : install php requirements for joomla] ******************************* failed: [joomla] (item=[u'php7.1-json', u'php7.1-xml', u'php7.1-mbstring', u'php7.1-intl', u'php7.1-apache', u'php7.1-mysql', u'php7.1-pgsql']) => {"changed": false, "failed": true, "item": ["php7.1-json", "php7.1-xml", "php7.1-mbstring", "php7.1-intl", "php7.1-apache", "php7.1-mysql", "php7.1-pgsql"], "msg": "No package matching 'php7.1-apache' is available"} to retry, use: --limit @/home/artur/php-joomla-vm/provisioning/playbook.`

---

<div class="post-metadata">

**Author:** ![Artur001](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Artur001](https://forum.ansible.com/u/Artur001)\
**Post date:** [November 2, 2017, 10:10am UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/4 "2017-11-02T10:10:25Z")

</div>

my project  
[Project](https://github.com/Robocop01/php-joomla-vm.git)

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [November 2, 2017, 12:15pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/5 "2017-11-02T12:15:54Z")

</div>

There’s no package named php7.1-apcache in that ppa. correct the spelling.

Packages in that ppa which start with php7.1 are here [http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/](http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/)

-Toshio

---

<div class="post-metadata">

**Author:** ![Mehul\_Ved](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mehul\_Ved](https://forum.ansible.com/u/Mehul_Ved)\
**Post date:** [November 2, 2017, 12:24pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/6 "2017-11-02T12:24:37Z")

</div>

I believe the package you’re looking for is php-opcache. It’s there in the ppa too. opcache is the object caching module in php - [http://php.net/manual/en/intro.opcache.php](http://php.net/manual/en/intro.opcache.php)

---

<div class="post-metadata">

**Author:** ![Artur001](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Artur001](https://forum.ansible.com/u/Artur001)\
**Post date:** [November 2, 2017, 3:02pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/7 "2017-11-02T15:02:37Z")

</div>

This package is present:

`  
~/Загрузки$ php -v  
PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 13:49:56) ( NTS )  
Copyright (c) 1997-2017 The PHP Group  
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies  
with Zend OPcache v7.1.11-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

`

---

<div class="post-metadata">

**Author:** ![Werner\_Flamme](https://avatars.discourse-cdn.com/v4/letter/w/c68b51/32.png) [@Werner\_Flamme](https://forum.ansible.com/u/Werner_Flamme)\
**Post date:** [November 2, 2017, 3:23pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/8 "2017-11-02T15:23:46Z")

</div>

Artur001 [02.11.2017 16:02]:

> This package is present:
> 
> ~/Загрузки$ php -v  
> PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 13:49:56  
> ) ( NTS )  
> Copyright (c) 1997-2017 The PHP Group  
> Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies  
> &nbsp;&nbsp;&nbsp;&nbsp;with Zend OPcache v7.1.11-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c)  
> 1999-2017, by Zend Technologies

Following the error text you sent, you do not try to install  
php7-opcache, but php7-apache.

- name: install php requirements for joomla  
&nbsp;&nbsp;apt: name=php{{ php.version }}-{{ item }} state=present  
&nbsp;&nbsp;with\_items:  
[...]  
&nbsp;&nbsp;&nbsp;&nbsp;- apcache  
[...]

this should read opcache then.

---

<div class="post-metadata">

**Author:** ![Artur001](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Artur001](https://forum.ansible.com/u/Artur001)\
**Post date:** [November 2, 2017, 5:12pm UTC](https://forum.ansible.com/t/ansible-problem-install-php/25891/9 "2017-11-02T17:12:36Z")

</div>

You right!  
I did not see message of Toshlo Kuratoml.
