Di IT Center ID kami menjalankan beberapa versi PHP yang berbeda.
Di server SSH kami, eksekusi perintah seperti "composer" akan berjalan dengan PHP tingkat sistem default kami yang juga digunakan untuk alat internal di IT Center ID. Ini adalah versi tipis PHP tanpa semua modul yang mungkin biasa Anda gunakan di situs web Anda. Untuk mengaktifkan penggunaan perintah ini, Anda perlu menentukan path lengkap ke versi PHP yang ingin Anda jalankan skripnya. Anda dapat melakukan ini pada baris perintah itu sendiri.
Berikut adalah contoh penggunaan PHP 7.1 untuk mengeksekusi Composer:
/usr/bin/php71 -f /usr/bin/composer
Jadi perintah lengkapnya adalah:
/usr/bin/php71 -f /usr/bin/composer install
Daftar versi PHP yang tersedia disajikan kepada Anda dalam message of the day (MOTD) setelah Anda masuk ke SSH.
How do I run Composer via SSH?
At IT Center ID we run multiple different versions of PHP.
On our SSH servers, the execution of commands like “composer” will run with our default, system-level PHP that is also used for internal tools at IT Center ID. This is a thin version of PHP without all the modules you may be used-to on your website. To enable use of this command, you need to specify the full path to the version of PHP that you wish to run the script as. You can do this on the command line itself.
Here's an example of using PHP 7.1 to execute Composer:
/usr/bin/php71 -f /usr/bin/composer
So the complete command would become:
/usr/bin/php71 -f /usr/bin/composer install
A list of available PHP versions is presented to you in the message of the day (MOTD) once you login to SSH.
