檢視 PHP 的原始碼
←
PHP
跳至導覽
跳至搜尋
由於以下原因,您無權編輯此頁面:
您請求的操作只有這個群組的使用者能使用:
使用者
您可以檢視並複製此頁面的原始碼。
'''PHP'''是一個程式語言。 == 安裝 == 在[[Debian]]下的testing可以直接安裝系統的PHP: <syntaxhighlight lang="bash"> sudo apt update; sudo apt install -y composer php-apcu php-bcmath php-bz2 php-cli php-curl php-dba php-ds php-fpm php-gd php-gmp php-imagick php-intl php-ldap php-mbstring php-memcache php-memcached php-mysql php-odbc php-opcache php-pcov php-pgsql php-readline php-redis php-snmp php-soap php-sqlite3 php-tidy php-uuid php-xml php-xmlrpc php-xsl php-yaml php-zip; sudo apt clean </syntaxhighlight> 在[[Ubuntu]]下可以用下面指令安裝ondrej PPA版的PHP,目前在[[Ubuntu]] 24.04下php-decimal編不出來,需要自己先拿掉。 PHP 7.4: <syntaxhighlight lang="bash"> sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php; sudo apt update; sudo apt install -y composer php7.4-apcu php7.4-bcmath php7.4-bz2 php7.4-cli php7.4-curl php7.4-dba php7.4-decimal php7.4-ds php7.4-fpm php7.4-gd php7.4-gmp php7.4-imap php7.4-imagick php7.4-inotify php7.4-intl php7.4-json php7.4-ldap php7.4-lz4 php7.4-mbstring php7.4-memcache php7.4-memcached php7.4-mysql php7.4-odbc php7.4-opcache php7.4-pcov php7.4-pgsql php7.4-readline php7.4-redis php7.4-snmp php7.4-soap php7.4-sqlite3 php7.4-tidy php7.4-uuid php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-yaml php7.4-zip php7.4-zstd; sudo apt clean </syntaxhighlight> PHP 8.0: <syntaxhighlight lang="bash"> sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php; sudo apt update; sudo apt install -y composer php8.0-apcu php8.0-bcmath php8.0-bz2 php8.0-cli php8.0-curl php8.0-dba php8.0-decimal php8.0-ds php8.0-fpm php8.0-gd php8.0-gmp php8.0-imap php8.0-imagick php8.0-inotify php8.0-intl php8.0-ldap php8.0-lz4 php8.0-mbstring php8.0-memcache php8.0-memcached php8.0-mysql php8.0-odbc php8.0-opcache php8.0-pcov php8.0-pgsql php8.0-readline php8.0-redis php8.0-snmp php8.0-soap php8.0-sqlite3 php8.0-tidy php8.0-uuid php8.0-xml php8.0-xmlrpc php8.0-xsl php8.0-yaml php8.0-zip php8.0-zstd; sudo apt clean </syntaxhighlight> PHP 8.1: <syntaxhighlight lang="bash"> sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php; sudo apt update; sudo apt install -y composer php8.1-apcu php8.1-bcmath php8.1-bz2 php8.1-cli php8.1-curl php8.1-dba php8.1-decimal php8.1-ds php8.1-fpm php8.1-gd php8.1-gmp php8.1-imap php8.1-imagick php8.1-inotify php8.1-intl php8.1-ldap php8.1-mbstring php8.1-memcache php8.1-memcached php8.1-mysql php8.1-odbc php8.1-opcache php8.1-pcov php8.1-pgsql php8.1-readline php8.1-redis php8.1-snmp php8.1-soap php8.1-sqlite3 php8.1-tidy php8.1-uuid php8.1-xml php8.1-xmlrpc php8.1-xsl php8.1-yaml php8.1-zip php8.1-zstd; sudo apt clean </syntaxhighlight> PHP 8.2: <syntaxhighlight lang="bash"> sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php; sudo apt update; sudo apt install -y composer php8.2-apcu php8.2-bcmath php8.2-bz2 php8.2-cli php8.2-curl php8.2-dba php8.2-decimal php8.2-ds php8.2-fpm php8.2-gd php8.2-gmp php8.2-imap php8.2-imagick php8.2-inotify php8.2-intl php8.2-ldap php8.2-mbstring php8.2-memcache php8.2-memcached php8.2-mysql php8.2-odbc php8.2-opcache php8.2-pcov php8.2-pgsql php8.2-readline php8.2-redis php8.2-snmp php8.2-soap php8.2-sqlite3 php8.2-tidy php8.2-uuid php8.2-xml php8.2-xmlrpc php8.2-xsl php8.2-yaml php8.2-zip php8.2-zstd; sudo apt clean </syntaxhighlight> PHP 8.3: <syntaxhighlight lang="bash"> sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php; sudo apt update; sudo apt install -y composer php8.3-apcu php8.3-bcmath php8.3-bz2 php8.3-cli php8.3-curl php8.3-dba php8.3-decimal php8.3-ds php8.3-fpm php8.3-gd php8.3-gmp php8.3-imap php8.3-imagick php8.3-inotify php8.3-intl php8.3-ldap php8.3-mbstring php8.3-memcache php8.3-memcached php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pcov php8.3-pgsql php8.3-readline php8.3-redis php8.3-snmp php8.3-soap php8.3-sqlite3 php8.3-tidy php8.3-uuid php8.3-xml php8.3-xmlrpc php8.3-xsl php8.3-yaml php8.3-zip php8.3-zstd; sudo apt clean </syntaxhighlight> PHP 8.4: <syntaxhighlight lang="bash"> sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php; sudo apt update; sudo apt install -y composer php8.4-apcu php8.4-bcmath php8.4-bz2 php8.4-cli php8.4-curl php8.4-dba php8.4-ds php8.4-fpm php8.4-gd php8.4-gmp php8.4-imap php8.4-imagick php8.4-intl php8.4-ldap php8.4-mbstring php8.4-memcache php8.4-memcached php8.4-mysql php8.4-odbc php8.4-opcache php8.4-pcov php8.4-pgsql php8.4-readline php8.4-redis php8.4-snmp php8.4-soap php8.4-sqlite3 php8.4-tidy php8.4-uuid php8.4-xml php8.4-xmlrpc php8.4-xsl php8.4-yaml php8.4-zip; sudo apt clean </syntaxhighlight> == 設定 == 如果要把opcache加大為256MB(預設應該是128MB): <syntaxhighlight lang="ini"> [opcache] opcache.memory_consumption=256 </syntaxhighlight> == 管理 == 比較大的專案或是同一台機器跑多個PHP專案時,可能會吃完opcache的cache(預設是128MB),可以考慮安裝[https://github.com/JorgenEvens/php-cache-dashboard php-cache-dashboard]觀察cache的使用率。 == 外部連結 == * {{Official|https://secure.php.net/}} [[Category:程式語言]]
此頁面使用了以下模板:
Template:Official
(
檢視原始碼
)
Template:Official website
(
檢視原始碼
)
Module:Arguments
(
檢視原始碼
)
Module:Official website
(
檢視原始碼
)
Module:URL
(
檢視原始碼
)
返回到「
PHP
」。
導覽選單
個人工具
登入
命名空間
頁面
討論
臺灣正體
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
視圖
閱讀
檢視原始碼
檢視歷史
更多
搜尋
導覽
首頁
近期變更
隨機頁面
MediaWiki說明
工具
連結至此的頁面
相關變更
特殊頁面
頁面資訊