0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CPI サーバーで concrete5 CLI を使えるようにする方法

Last updated at Posted at 2021-01-03

SSH でログイン

CPI サーバーに SSH でログインできるよう設定する

PHP コマンドを使えるように設定ファイルを作成

.cshrc ファイルに PHP コマンドで PHP7.2 が起動するようにする

$ cd
# 旧サーバープランの場合
$ echo alias php php-7.2  >> .cshrc
# シェアードプラン Business Standard の場合
## PHP 7.4
echo alias php /usr/local/bin/php-7.4 >> .cshrc
## PHP 8.0
echo alias php /usr/local/bin/php-8.0 >> .cshrc
## PHP 8.1
echo alias php /usr/local/bin/php-8.1 >> .cshrc
# 変更を反映させる
source .cshrc

SSH ログアウト&再ログイン

一旦、SSH をログアウト

$ exit

再度ログイン

動作確認

PHP バージョンコマンドでうまく行ったかを確認

$ php -v

PHP 7.2.20 (cli) (built: Jul  8 2019 17:55:27) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

concrete5 CLI コマンドの実行方法

あとは、CLI コマンドを実行する前に php を必ずつけて実行します。

$ cd [concrete5 サイトのあるパス]
$ php concrete/bin/concrete5 [コマンド]

# 参考: 環境情報を出力する
$ php concrete/bin/concrete5 c5:info

設定を変更する場合

.cshrc テキストファイルに php コマンドだったら上記のコマンドを叩くという設定を加えているので、PHPバージョンの変更などをする際は、.cshrc テキストファイルを開いて中身を編集します。

参考情報

参考
https://mi-rai.co.jp/blog/876
https://support.cpi.ad.jp/manual/bs/tools/sshkeys

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?