# Apt removed php when updated Apache to the latest

**URL:** <https://forum.ansible.com/t/apt-removed-php-when-updated-apache-to-the-latest/17158>\
**Category:** Ansible Project\
**Created:** [December 30, 2014, 9:49am UTC](https://forum.ansible.com/t/apt-removed-php-when-updated-apache-to-the-latest/17158 "2014-12-30T09:49:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjp](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@hjp](https://forum.ansible.com/u/hjp)\
**Post date:** [December 30, 2014, 9:49am UTC](https://forum.ansible.com/t/apt-removed-php-when-updated-apache-to-the-latest/17158/1 "2014-12-30T09:49:48Z")

</div>

I’m new with this yes,

I try to update apache2 to the latest llike this in my yml:

_tasks:_  
_- name: update packages_  
_apt: name=apache2 state=latest update\_cache=yes_

It went fine but apache didn’t start anymore because php was messed up. Apt-log shows:

_Start-Date: 2014-12-30 10:57:20_  
_Commandline: /usr/bin/apt-get -y -o Dpkg::Options::=–force-confdef -o Dpkg::Options::=–force-confold install apache2_  
_Install: apache2-mpm-itk:amd64 (2.2.22-1ubuntu1.7, automatic)_  
_Upgrade: apache2:amd64 (2.2.22-1ubuntu1.4, 2.2.22-1ubuntu1.7), apache2.2-common:amd64 (2.2.22-1ubuntu1.4, 2.2.22-1ubuntu1.7), apache2.2-bin:amd64 (2.2.22-1ubuntu1.4, 2.2.22-1ubuntu1.7)_  
_**Remove: libapache2-mod-php5:amd64 (5.3.10-1ubuntu3.15), apache2-mpm-prefork:amd64 (2.2.22-1ubuntu1.4)**_  
_End-Date: 2014-12-30 10:57:28_

… so it removed php5. When I installed libapache2-mod-php5:amd64 back, it works again.

What did I do wrong? How can I update one package and it’s required dependencies correctly without updating the whole system?

Thanks.
