跳轉到內容
View in the app

A better way to browse. Learn more.

PHP論壇人

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

1.安裝PHP與配置、安裝redis、安裝exif、安裝imagick

精選回覆

發表於

-----------------------------
安裝sury.org的PHP源
-----------------------------

wget -O /usr/share/keyrings/php.gpg https://packages.sury.org/php/apt.gpg


echo "deb [signed-by=/usr/share/keyrings/php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list


更新源
apt update


apt upgrade -y


apt dist-upgrade -y


apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates


apt install php-pear

 


瀏覽pear版本
pear version

 

apt install php8.3-{fpm,cli,mysql,curl,gd,mbstring,xml,zip,imap,soap,gmp,bcmath,redis} -y

 

如果要安裝其他元件,可以搜尋看看有無對應的套件
apt-cache search php8.3* | grep php

 


修改 php.ini 防止跨目录攻击
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/8.3/fpm/php.ini

 


設置系統預設的PHP版本
update-alternatives --list php


update-alternatives --set php /usr/bin/php8.3


update-alternatives --config php


重啟PHP
systemctl restart php8.3-fpm

 

 


---------------------------------------
安裝redis、安裝exif、安裝imagick
---------------------------------------

apt install redis

apt install php-redis

apt install exif

apt install imagemagick

 

ldconfig /usr/local/lib

apt install php-imagick

 

重啟PHP
systemctl restart php8.3-fpm

 

瀏覽已安裝的PHP擴展,已有exif、gmp、imagick、redis
/bin/php8.3 -m

 

 


------------------
修改php.ini
------------------

vi /etc/php/8.3/fpm/php.ini


使用Xshell 7 SSH軟體上面的選項,編輯 -> 尋找 -> 尋找目標,將能快速找到以下這些要修改的地方

 

停用危險函數
搜尋 
disable_functions =

修改为
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,pcntl_exec

 

搜尋以下這些,並修改它們的值

max_execution_time = 300

max_input_time = 180

memory_limit = 512M


顯示PHP程式錯誤,正式運作的論壇通常是 Off 關閉狀態
display_errors = Off


post_max_size = 100M

upload_max_filesize = 100M

max_file_uploads = 100

default_socket_timeout = 180

 

ESC儲存並離開
:wq

 


重啟PHP
systemctl restart php8.3-fpm


瀏覽PHP的版本,確定是安裝PHP 8.3
php -v

 

開機啟動PHP8.3
systemctl enable php8.3-fpm


啟動PHP8.3
systemctl start php8.3-fpm


瀏覽狀態
systemctl status php8.3-fpm

 

重開機
reboot

 

瀏覽狀態,確認重開機後,PHP有自動啟動
systemctl status php8.3-fpm


按 ctrl + z 停止

 

本文章最後於,由Jack編輯

  • 樓主

上面步驟,安裝PHP 8.3

 

在IPS論壇會跳出訊息

Invision Community 4.7.x 不支援/不支持 PHP 8.2、8.3、8.4

雖然我沒看出有啥大問題,但至少 widget 小部件/小工具 常常有幾個沒顯示

本文章最後於,由Jack編輯

  • 樓主

安裝 PHP 8.1

後續的步驟,有出現 PHP 8.3 的地方,記得也要改為 8.1

-----------------------------
安裝sury.org的PHP源
-----------------------------

apt install wget

wget -O /usr/share/keyrings/php.gpg https://packages.sury.org/php/apt.gpg


echo "deb [signed-by=/usr/share/keyrings/php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list

 

更新源

apt update

 

apt upgrade -y


apt dist-upgrade -y


apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates


apt install php-pear


瀏覽pear版本
pear version

 

apt install php8.1-{fpm,cli,mysql,curl,gd,mbstring,xml,zip,imap,soap,gmp,bcmath,redis} -y

 

如果要安裝其他元件,可以搜尋看看有無對應的套件
apt-cache search php8.1* | grep php


修改 php.ini 防止跨目录攻击
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/8.1/fpm/php.ini


設置系統預設的PHP版本
update-alternatives --list php


update-alternatives --set php /usr/bin/php8.1


update-alternatives --config php


重啟PHP
systemctl restart php8.1-fpm


---------------------------------------
安裝redis、安裝exif、安裝imagick
---------------------------------------

apt install redis -y


apt install php-redis -y


apt install exif -y


apt install imagemagick -y


ldconfig /usr/local/lib


apt install php8.1-imagick -y

 

重啟PHP
systemctl restart php8.1-fpm

 

瀏覽已安裝的PHP擴展,已有exif、gmp、imagick、redis
/bin/php8.1 -m

 


------------------
修改php.ini
------------------

vi /etc/php/8.1/fpm/php.ini


使用Xshell 7 SSH軟體上面的選項,編輯 -> 尋找 -> 尋找目標,將能快速找到以下這些要修改的地方

 

停用危險函數

搜尋 

disable_functions =

 

修改为

disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,pcntl_exec

 

搜尋以下這些,並修改它們的值

max_execution_time = 300

max_input_time = 180

memory_limit = 512M


顯示PHP程式錯誤,正式運作的論壇通常是 Off 關閉狀態
display_errors = Off


post_max_size = 100M

upload_max_filesize = 100M

max_file_uploads = 100

default_socket_timeout = 180

 

ESC儲存並離開
:wq

 


重啟PHP
systemctl restart php8.1-fpm


瀏覽PHP的版本,確定是安裝PHP 8.1
php -v

 

開機啟動PHP8.1
systemctl enable php8.1-fpm


啟動PHP8.1
systemctl start php8.1-fpm

 


瀏覽狀態
systemctl status php8.1-fpm

 

重開機
reboot

 

瀏覽狀態,確認重開機後,PHP有自動啟動
systemctl status php8.1-fpm


按 ctrl + z 停止

 

後續的步驟,有出現 PHP 8.3 的地方,記得也要改為 8.1

 

本文章最後於,由Jack編輯

建立帳號或登入後發表意見

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.