phpをインストールした後にやるべきこと

2022年6月17日

前提

書くこと/書かないこと

phpをインストールした状態では不要な設定が有効になっていますので、必ず実施すべき作業について書きます。

環境

AlmaLinux 8.6 ※CentOS8代替OS

Apache/2.4.37 (AlmaLinux)

PHP 8.1.6 (cli)

さくっと

まずはphp.iniから。

phpのバージョンを晒さないよう、expose_phpはOffにします。

(説明の便宜上、上で晒してますけど。。。)

;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;

; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header).  It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
; https://php.net/expose-php
;expose_php = On
expose_php = Off

php.iniを修正したらapacheを再起動します。php-fpmではないので注意してください。

systemctl restart httpd.service

こってりと

時間とができてやる気が出たら加筆します(しないかも)。