今回はPHPネタです。
筆者のWEBサーバ環境はArchLinuxでOpenLiteSpeedの1.7.15を使用しており、
PHPは8.1.3でWordPressを稼働させています。

今回はPHPの8.1.4の最新版がリリースされたので早速試してみました。

尚、OpenLiteSpeedの管理画面を使わない方法で実施します。


PHPのダウンロード

まずはPHP8.1.4のソースコードをダウンロードします。

$ wget https://www.php.net/distributions/php-8.1.4.tar.gz

以下コマンドで解凍します。

$ tar xvzf php-8.1.4.tar.gz  

次に解凍後のディレクトリに入ります。

$ cd php-8.1.4

コンフィグの作成

以下コマンドでコンフィグを作成します。

$ ./configure -prefix=/usr/local/lsws/lsphp81 '--with-mysqli' '--with-zlib' '--enable-gd' '--enable-gd-jis-conv' '--enable-shmop' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--with-iconv' '--with-pdo-mysql' '--enable-ftp' '--with-curl' '--enable-soap' '--enable-xml' '--with-openssl' '--enable-bcmath' '--enable-exif' '--with-jpeg' '--with-freetype' '--with-gettext' '--with-bz2' '--enable-litespeed' '--enable-opcache' '--with-zip' '--with-xpm' '--enable-intl'

コンフィグが無事に終わると以下メッセージが表示されます。

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE. By continuing this installation  |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

ビルドして、インストールします。

$ make
$ sudo make -k install

シンボリックリンクの貼り直し

$ sudo cp /usr/local/lsws/lsphp81/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp-8.1.4
$ sudo rm /usr/local/lsws/fcgi-bin/lsphp81
$ sudo ln -s  /usr/local/lsws/fcgi-bin/lsphp-8.1.4 /usr/local/lsws/fcgi-bin/lsphp81

この後、OpenLiteSpeedを再起動することでPHP8.1.4が利用可能になります。


まとめ

今回はOpenLiteSpeed1.7.15でPHP8.1.4を使う方法について紹介しました。

何かの参考になれば幸いです。