Access from '18.188.218.219'
You are in US.
It is 09:16 JST now.
You are in US.
It is 09:16 JST now.
Apache に FastCGI Process Manager, php-fpm
- Apache2 の設定した上で php-fpm をインストール
# apt -y install php-fpm
- php-fpm を使用したい Virtualhost の設定を行う。 余談ですが、php8.2をphp8.1にすればUbuntu22.04でもOK.
# vi /etc/apache2/sites-enabled/<your site config file> | | <FilesMatch \.php$>
設定サンプルはこちら。
SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost/"
</FilesMatch> | | - 以下のコマンドを実行。
# a2enmod proxy_fcgi setenvif # chown www-data: /var/www/<your site top directory> # find /var/www/<your site top directory> -type d -print | xargs chmod 775 # find /var/www/<your site top directory> -type f -print | xargs chmod 664 # systemctl restart apache2.service
- 動作確認
# echo '<?php phpinfo(); ?>' > /var/www/<your site top directory>/info.php
http://your-site/info.php を表示し、下記の様に Server APIが FPM/FastCGIなっていることを確認。
WordPress等を考慮してインストールした、php モジュール
php-apcu php-bz2 php-common php-composer-ca-bundle php-fig-http-message-util
php-fpm php-getallheaders php-gmp php-google-recaptcha php-imagick php-intl
php-json php-mariadb-mysql-kbs php-mcrypt php-mysql php-nikic-fast-route php-bcmath
php-phpmyadmin-motranslator php-phpmyadmin-shapefile php-phpmyadmin-sql-parser
php-psr-cache php-psr-container php-psr-http-factory php-psr-http-message php-psr-log
php-slim-psr7 php-symfony-cache php-symfony-cache-contracts php-symfony-config
php-symfony-dependency-injection php-symfony-deprecation-contracts
php-symfony-expression-language php-symfony-filesystem php-symfony-polyfill-php80
php-symfony-service-contracts php-symfony-var-exporter php-tcpdf php-twig php-twig-i18n-extension
php-webmozart-assert php8.2 php8.2-apcu php8.2-bz2 php8.2-cli php8.2-common php8.2-curl
php8.2-fpm php8.2-gd php8.2-gmp php8.2-imagick php8.2-intl php8.2-mbstring php8.2-mcrypt
php8.2-mysql php8.2-opcache php8.2-readline php8.2-xml php8.2-zip
php-fpm php-getallheaders php-gmp php-google-recaptcha php-imagick php-intl
php-json php-mariadb-mysql-kbs php-mcrypt php-mysql php-nikic-fast-route php-bcmath
php-phpmyadmin-motranslator php-phpmyadmin-shapefile php-phpmyadmin-sql-parser
php-psr-cache php-psr-container php-psr-http-factory php-psr-http-message php-psr-log
php-slim-psr7 php-symfony-cache php-symfony-cache-contracts php-symfony-config
php-symfony-dependency-injection php-symfony-deprecation-contracts
php-symfony-expression-language php-symfony-filesystem php-symfony-polyfill-php80
php-symfony-service-contracts php-symfony-var-exporter php-tcpdf php-twig php-twig-i18n-extension
php-webmozart-assert php8.2 php8.2-apcu php8.2-bz2 php8.2-cli php8.2-common php8.2-curl
php8.2-fpm php8.2-gd php8.2-gmp php8.2-imagick php8.2-intl php8.2-mbstring php8.2-mcrypt
php8.2-mysql php8.2-opcache php8.2-readline php8.2-xml php8.2-zip