diff --git a/tasks/php.yml b/tasks/php.yml
index 400a7e38ae42b1c2be4b149278f34d3728298833..b711a31567163bb50ab512502b9e24cde4f2fe0f 100644
--- a/tasks/php.yml
+++ b/tasks/php.yml
@@ -163,7 +163,7 @@
     owner: root
     group: root
     mode: 0644
-  when: (php_version_main|default(7) == 7) and php_fpm
+  when: (php_version_main|default(7) == 7) and php_fpm and apache_server_default
   notify:
     - Restart PHP-FPM