Sionの日記

オッサンゲーマー

RaspberryPi:RompRが動かない

RaspberryPi OSをbullseyeにアップグレードしたところ、RompR(mpdのWebUI)が動かなくなったので調査。

 

phpがバージョンアップしているので、パスが変わっている。

PHPのバージョンを調べてみると7.4になっていた。

pi@rpi3bplus:~ $ php -v
PHP 7.4.21 (cli) (built: Jul  2 2021 03:59:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.21, Copyright (c), by Zend Technologies
pi@rpi3bplus:~ $

/etc/nginx/sites-available/rompr

fastcgi_passをphp7.3からphp7.4に変更

    location /RompR/ {
        allow all;
        index index.php;
        location ~ \.php {
                try_files $uri index.php =404;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $request_filename;
                include /etc/nginx/fastcgi_params;
                fastcgi_read_timeout 1800;
        }

php.ini

php.iniの設定を7.3から持ってくる(デフォルトのphp.iniを7.3のファイルを見ながら書き換え)

元ファイル:/etc/php/7.3/fpm/php.ini

新ファイル:/etc/php/7.4/fpm/php.ini

更新するのは、以下の内容

allow_url_fopen = On
memory_limit = 128M
max_execution_time = 1800
post_max_size = 256M
upload_max_filesize = 10M
max_file_uploads = 200

phpとnginxを再起動

pi@rpi3bplus:~ $ sudo systemctl restart php7.4-fpm.service
pi@rpi3bplus:~ $ sudo systemctl restart nginx.service
pi@rpi3bplus:~ $

動くようになったぜ。

f:id:sionx360_game:20210912103521p:plain

RompR

起動してみたら、RompRのバージョンが上がってた。面倒なのでgit からpullするスクリプトを作成した。次回からシェル実行一発でOKなはず。

/var/www/RompR/update_rompr.sh

sudo git pull -v
sudo chown -R www-data /var/www/RompR
sudo chgrp -R www-data /var/www/RompR
sudo systemctl restart php7.4-fpm.service
sudo systemctl restart nginx.service

実行権限つけて終了。

pi@rpi3bplus:/var/www/RompR $ sudo chmod +x update_rompr.sh
pi@rpi3bplus:/var/www/RompR $

ちなみにgitからpullするとき文句言われた。

pi@rpi3bplus:/var/www/RompR $ sudo git pull -v
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
POST git-upload-pack (144 bytes)

~途中省略~

 34 files changed, 496 insertions(+), 96 deletions(-)
 create mode 100644 utils/checklocalcover.php
pi@rpi3bplus:/var/www/RompR $

ので、gitの設定も変えておく

pi@rpi3bplus:/var/www/RompR $ sudo git config pull.rebase false
pi@rpi3bplus:/var/www/RompR $ sudo git config pull.rebase true
pi@rpi3bplus:/var/www/RompR $ sudo git config pull.ff only
pi@rpi3bplus:/var/www/RompR $