"<p>In this tutorial, we'll show you how to provision a project environment with PHP and Composer. We'll start by installing PHP and its necessary extensions, including FPM, XML, MBString, MySQL, and GD, to ensure that our project environment is fully equipped to handle our needs. Finally, we'll install Composer, a popular dependency management tool for PHP, to enable us to manage our project's dependencies more efficiently.<br /> Here, we've included the code that we've written throughout this tutorial for you to reference and utilize in your own project development. </p> <pre> - name: add ondrej/php repo apt_repository: repo: "ppa:ondrej/php" state: present - name: install PHP and PHP extensions apt: update_cache: true name: - "php{{php_version}}" - "php{{php_version}}-fpm" - "php{{php_version}}-mysql" - "php{{php_version}}-mbstring" - "php{{php_version}}-xml" - "php{{php_version}}-zip" - "php{{php_version}}-curl" - "php{{php_version}}-gd" state: present - name: Disable PHP errors lineinfile: dest: "/etc/php/{{ php_version }}/fpm/php.ini" regexp: "display_errors=" line: "display_errors=0" notify: PHP restart - name: Installing Composer shell: | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" mv composer.phar /usr/local/bin/composer args: creates: /usr/local/bin/composer</pre>"