参考url
- https://qiita.com/daichi_pd/items/1d9b4c8bef2579abc670
- https://qiita.com/hamburg-love/items/ae819a7abf921af77376
- https://itc-engineering-blog.netlify.app/blogs/rhel9-apache-php-postgresql
install apache httpd php php-fpm
$ sudo yum install httpd $ sudo yum install php php-fpm $ httpd -v Server version: Apache/2.4.37 (Oracle Linux) Server built: Oct 24 2023 23:52:21 $ php-fpm -v PHP 7.2.24 (fpm-fcgi) (built: Oct 22 2019 08:28:36) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
$ sudo vi /etc/httpd/conf.modules.d/00-mpm.conf
00-mpm.conf に以下を追記
<IfModule mpm_event_module> StartServers 3 MinSpareThreads 24 MaxSpareThreads 48 ThreadsPerChild 64 MaxRequestWorkers 128 MaxConnectionsPerChild 0 <FilesMatch \.php$> SetHandler "proxy:fcgi://127.0.0.1:9000" </FilesMatch> </IfModule>
php-fpm , apache httpd 起動
$ sudo systemctl restart php-fpm $ sudo systemctl restart httpd
接続テスト
$ sudo vi /var/www/html/test.php <?php echo phpinfo(); ?>
↑このような test.php を用意し、ブラウザでアクセス