--- - name: install Remi repo for Rocky/RHEL 8 yum: name: https://rpms.remirepo.net/enterprise/remi-release-8.rpm disable_gpg_check: true state: present become: true - name: reset module php command: dnf module reset php -y args: warn: false changed_when: true become: true - name: enable module php 8.1 command: dnf module enable php:remi-8.1 -y args: warn: false changed_when: true become: true - name: install php8-fpm and modules yum: name: - php-fpm - php-cli - php-gd - php-mbstring - php-ldap - php-bcmath - php-xml - php-pdo - php-mysql - php-intl - php-mysqlnd - php-pear - php-opcache - php81-libzip - php-pecl-zip state: present notify: restart_httpd become: true - name: copy php.ini copy: src: php81/php.ini dest: /etc/php.ini become: true - name: copy phpfpm-php.conf copy: src: php81/phpfpm-php.conf dest: /etc/httpd/conf.d/phpfpm-php.conf become: true notify: restart_httpd - name: replace listen ip address an port replace: path: /etc/php-fpm.d/www.conf regexp: "^listen = /run/php-fpm/www.sock" replace: "listen = 127.0.0.1:9000" become: true notify: restart_php-fpm - name: disable mpm_prefork replace: path: /etc/httpd/conf.modules.d/00-mpm.conf regexp: '^LoadModule mpm_prefork_module( *.*)' replace: '#LoadModule mpm_prefork_module\1' notify: restart_httpd become: true - name: enable mpm_event replace: path: /etc/httpd/conf.modules.d/00-mpm.conf regexp: '^#LoadModule mpm_event_module( *.*)' replace: 'LoadModule mpm_event_module\1' become: true notify: restart_httpd - name: create folder for log php-fpm file: path: /var/log/php-fpm/ state: directory become: true - name: copy phpinfo.php file copy: src: httpd/phpinfo.php dest: /var/www/html/intranet/phpinfo.php become: true