安裝 PHP PEAR
1.透過 SSH 以 root 權限登入 DSM (請參閱此文章,以了解詳細步驟)。
2.使用 wget 指令來下載 go-pear.phar 檔案:
wget https://pear.php.net/go-pear.phar
3.藉由您的 PHP 套件來執行 go-pear.phar 檔案。下方指令以 PHP 7.3 為例:
sudo PHP_PEAR_PHP_BIN=/usr/local/bin/php73 php73 go-pear.phar
4.按照螢幕上的指示來安裝。建議將 PHP code directory (PHP 程式碼目錄)及 Data directory (資料目錄) 儲存至共用資料夾,以確保檔案可透過 DSM 備份及還原。
Below is a suggested file layout for your new PEAR installation.To change individual locations, type the number in front of the directory.Type 'all' to change all of them or simply press Enter to accept these locations. 1.Installation base ($prefix)-------------------:/usr/local 2.Temporary directory for processing------------:/tmp/pear/install 3.Temporary directory for downloads-------------:/tmp/pear/install 4.Binaries directory----------------------------:/usr/local/bin 5. PHP code directory ($php_dir)---------------------------: /usr/local/share/pear 6.Documentation directory-----------------------:/usr/local/docs 7. Data directory------------------------------------------: /usr/local/data 8.User-modifiable configuration files directory-:/usr/local/cfg 9.Public Web Files directory--------------------:/usr/local/www 10.System manual pages directory----------------:/usr/local/man 11.Tests directory------------------------------:/usr/local/tests 12.Name of configuration file-------------------:/usr/local/etc/php73/pear.conf 1-12, 'all' or Enter to continue:
5.當畫面跳出下方訊息,確認是否修改 php.ini 檔案時,輸入「N」。
Would you like to alter php.ini </usr/local/etc/php73/cli/php.ini>?
6.按一下 Enter 鍵。
7.PHP PEAR 已安裝至您的 DSM
https://kb.synology.com/zh-hk/DSM/tutorial/How_to_install_PEAR_on_DSM7