Debian安装 PHP

Debian
安装软件源拓展工具:

apt -y install software-properties-common apt-transport-https lsb-release ca-certificates

添加 GPG

wget -O /etc/apt/trusted.gpg.d/php.gpg https://mirror.xtom.com.hk/sury/php/apt.gpg

添加 sury 软件源

sh -c 'echo "deb https://mirror.xtom.com.hk/sury/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'   

更新软件源缓存:

apt-get update

安装软件

安装 PHP7.3:

apt install php7.3-fpm php7.3-mysql php7.3-curl php7.3-gd php7.3-mbstring php7.3-xml php7.3-xmlrpc php7.3-zip php7.3-opcache -y

设置 PHP

安装完成后,编辑 /etc/php/7.3/fpm/php.ini 替换换 ;cgi.fix_pathinfo=1 为 cgi.fix_pathinfo=0 快捷命令:

sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/7.3/fpm/php.ini 

管理 PHP

安装好了先重启一下!

systemctl restart php7.3-fpm

更多操作:

systemctl restart php7.3-fpm #重启

systemctl start php7.3-fpm #启动

systemctl stop php7.3-fpm #关闭

systemctl status php7.3-fpm #检查状态

查看 PHP

验证一下是否安装成功: php -v

PHP 7.3.0-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Dec 6 2018 20:24:55) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

with Zend OPcache v7.3.0-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

更新 PHP

运行下面的命令系统就会更新所有可以更新的软件包括 PHP

apt update

apt upgrade -y

安装更多组件

上面的一条命令安装 PHP 只是安装了部分 PHP 拓展,更多的软件可见:

root@mfrvice:~# apt-cache search php7.3

php-amqp - AMQP extension for PHP

php-apcu - APC User Cache for PHP

php-apcu-bc - APCu Backwards Compatibility Module

php-ds - PHP extension providing efficient data structures for PHP 7

php-gearman - PHP wrapper to libgearman

php-geoip - GeoIP module for PHP

php-gmagick - Provides a wrapper to the GraphicsMagick library

php-gnupg - PHP wrapper around the gpgme library

php-http - PECL HTTP module for PHP Extended HTTP Support

php-igbinary - igbinary PHP serializer

php-imagick - Provides a wrapper to the ImageMagick library

php-mailparse - Email message manipulation for PHP

php-memcache - memcache extension module for PHP

php-memcached - memcached extension module for PHP, uses libmemcached

php-mongodb - MongoDB driver for PHP

php-msgpack - PHP extension for interfacing with MessagePack

php-oauth - OAuth 1.0 consumer and provider extension

php-propro - propro module for PHP

php-radius - radius client library for PHP

php-raphf - raphf module for PHP

php-redis - PHP extension for interfacing with Redis

php-rrd - PHP bindings to rrd tool system

php-smbclient - PHP wrapper for libsmbclient

php-solr - PHP extension for communicating with Apache Solr server

php-ssh2 - Bindings for the libssh2 library

php-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP

php-tideways - Tideways PHP Profiler Extension

php-uploadprogress - file upload progress tracking extension for PHP

php-uuid - PHP UUID extension

php-yac - YAC (Yet Another Cache) for PHP

php-yaml - YAML-1.1 parser and emitter for PHP

php-zmq - ZeroMQ messaging bindings for PHP

php-xdebug - Xdebug Module for PHP

php-lua - PHP Embedded lua interpreter

libapache2-mod-php7.3 - server-side, HTML-embedded scripting language (Apache 2 module)

libphp7.3-embed - HTML-embedded scripting language (Embedded SAPI library)

php7.3-bcmath - Bcmath module for PHP

php7.3-bz2 - bzip2 module for PHP

php7.3-cgi - server-side, HTML-embedded scripting language (CGI binary)

php7.3-cli - command-line interpreter for the PHP scripting language

php7.3-common - documentation, examples and common module for PHP

php7.3-curl - CURL module for PHP

php7.3-dba - DBA module for PHP

php7.3-dev - Files for PHP7.3 module development

php7.3-enchant - Enchant module for PHP

php7.3-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)

php7.3-gd - GD module for PHP

php7.3-gmp - GMP module for PHP

php7.3-imap - IMAP module for PHP

php7.3-interbase - Interbase module for PHP

php7.3-intl - Internationalisation module for PHP

php7.3-json - JSON module for PHP

php7.3-ldap - LDAP module for PHP

php7.3-mbstring - MBSTRING module for PHP

php7.3-mysql - MySQL module for PHP

php7.3-odbc - ODBC module for PHP

php7.3-opcache - Zend OpCache module for PHP

php7.3-pgsql - PostgreSQL module for PHP

php7.3-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)

php7.3-pspell - pspell module for PHP

php7.3-readline - readline module for PHP

php7.3-recode - recode module for PHP

php7.3-snmp - SNMP module for PHP

php7.3-soap - SOAP module for PHP

php7.3-sqlite3 - SQLite3 module for PHP

php7.3-sybase - Sybase module for PHP

php7.3-tidy - tidy module for PHP

php7.3-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP

php7.3-xmlrpc - XMLRPC-EPI module for PHP

php7.3-zip - Zip module for PHP

php7.3-xsl - XSL module for PHP (dummy)

php7.3 - server-side, HTML-embedded scripting language (metapackage)

You may also like

  • 2023脚本收集,常用脚本备份
  • hestiacp的服务器管理,设置 DNS 群集,设置 FTP 备份服务器,设置远程数据库服务器
  • BT宝塔的替代品,一些主机面板汇总
  • 宝塔面板适合什么操作系统合安装
  • reset password.png, Feb 2021 Hestia Control Panel reset password重置密码
  • VPS上常用在线查询类的工具
  • cloudcone更换内核前需要先运行下面的命令,否则无法启动
  • debian安装vestacp,web存放位置