- name: Install PHP Packages
  become: yes
  apt: pkg={{ item }} state=latest
  with_items: php_packages

- name: Install PHP Packages
  become: yes
  apt: pkg={{ item }} state=latest
  with_items: '{{ php_packages }}'

Update format for with_items variable
Update format for with_items variable