- 1. 概要
- 2. php84
- 3. php84-extensions
- 4. mod_php84
1. 概要
「PHP」の詳細については「ウィキペディア - PHP」をご参照ください。
ここでは、ウェブサーバ上でデータベースを動作させる前提で記述している箇所があります。
先に「apache」や使用しようとするデータベースをインストールしてください。
2. php84
「PHP (プログラミング言語) - Wikipedia」によれば、「PHP 8.4」は、2024年11月にリリースされています。
どれだけのフレームワークが「PHP 8.4」で動作するかはわかりません。
もう、安定板となっているようなので、「PHP 8.4」をインストールします。
cd /usr/ports/lang/php84
make config
デフォルトの状態です。
スレッドセーフに動作させるには「ZTS」のオプションが必須になります。
今回「Apache」で、「MPM」の設定を「MPM_EVENT」にしていますので、「ZTS」のチェックをいれます。
あとは、デフォルトのままで。
cd /usr/ports/lang/php84
make NO_DIALOG=yes
make install
例によって依存関係があり、自動的にインストールされるものについては記述しません。
インストール時のメッセージを記載しておきます。
===> Installing for php84-8.4.8
===> Checking if php84 is already installed
===> Registering installation for php84-8.4.8
Installing php84-8.4.8...
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/lib/libphp.so
/usr/local/bin/php
/usr/local/bin/php-cgi
/usr/local/sbin/php-fpm
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
https://www.php.net/
3. php84-extensions
cd /usr/ports/lang/php84-extensions
make config
オプションが、ここにはる画像で一枚分、今までのバージョンより少なくなっています。
あまり多すぎるとわからなくなるので、ありがたいことです。
デフォルトでチェックされているものは、チェックをはずさないようにして。
下記へチェックをいれます。
・BCMATH 「Laravel」の日本語化に使用します
・BZ2 使うことがあります
・CURL 「WordPress」を使う予定があれば、更新のために必須
・EXIF 「Laravel」の日本語化に使用します
・FILEINFO 「Laravel」を使う予定があれば、必須
・FTP 「Laravel」の日本語化に使用します
・GD 使うことがあります
・GETTEXT 使うことがあります
・GMP 使うことがあります
・ITNL 使うことがあります
・MBSTRING 日本語を使う上で必須
(これが日本人にとって一番大事かもしれない)
・MYSQLI 「MySQL」を使用するのであれば、必須
・PDO_PGSQL 「postgreSQL」を使用するのであれば、必須
・PGSQL 「postgreSQL」を使用するのであれば、上記と合わせて、必須
「SYSTEMⅤ」系のモジュールを使用するのであれば「SYSVMSG」「SYSVMEM」「SYSVSHM」をチェックします。
(通常は、必要ないかな)
・ZIP 使うことがあります
・ZLIB 「WordPress」を使う予定があれば、更新のために必須
上記にデータベースのチェックについて記述していますが。
先にデータベースをインストールしていないと、「php」のインストール時に意図しないバージョンのクライアントがインストールされることがあります。
使用予定のバージョンがあれば、「php」より先にデータベースをインストールしておきます。
cd /usr/ports/lang/php84-extensions
make NO_DIALOG=yes
make install
「mbstring」について今後、「ports」のインストール時に設定を反映するように
vi /etc/make.conf
以下の1行を追加しておきます。
OPTIONS_SET+=MBSTRING
4. mod_php84
cd /usr/ports/www/mod_php84
make config
前項までと同様、「ZTS」オプションにチェックをいれます。
ほかは、デフォルトのままにしておきます。
cd /usr/ports/www/mod_php84
make NO_DIALOG=yes
make install
インストール時のメッセージを記載しておきます。
===> Installing for mod_php84-8.4.8
===> Checking if mod_php84 is already installed
===> Registering installation for mod_php84-8.4.8
Installing mod_php84-8.4.8...
[activating module 'php' in /usr/local/etc/apache24/httpd.conf]
******************************************************************************
Consider switching to php-fpm and mod_fast_cgi as per Apache httpd project
recommendation. See https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM
******************************************************************************
If you are building PHP-based ports in poudriere(8) or Synth with ZTS enabled,
add WITH_MPM=event to /etc/make.conf to prevent build failures.
******************************************************************************
Make sure index.php is part of your DirectoryIndex.
You should add the following to your Apache configuration file:
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
******************************************************************************
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/apache24/libphp.so
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
https://www.php.net/
|