# Why apt removed php when I tried just to update apache?

**URL:** <https://forum.ansible.com/t/why-apt-removed-php-when-i-tried-just-to-update-apache/17157>\
**Category:** Ansible Project\
**Created:** [December 30, 2014, 9:12am UTC](https://forum.ansible.com/t/why-apt-removed-php-when-i-tried-just-to-update-apache/17157 "2014-12-30T09:12:06Z")\
**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:12am UTC](https://forum.ansible.com/t/why-apt-removed-php-when-i-tried-just-to-update-apache/17157/1 "2014-12-30T09:12:06Z")

</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? I mean, if there is gonna be for example a security issue with a one package, how to update only it and all the packages that are related but not the whole system?

Thanks.
