zoukankan      html  css  js  c++  java
  • 安装 PHP

    Reference:  https://www.mf8.biz/debian-install-php7-2/

    安装 PHP

    Ondřej Surý 的 PHP PPA 为 Ubuntu 16.04/14.04 提供了 PHP7.2 版本,同时也有通过个人网站为 Debian 9/8 提供 PHP7.2 版本,因此 Ubuntu 是源于 Debian 所以基本可以通用,同时维护难度较低,软件源安装的 PHP 默认以 Unix Socket 的状态运行在 /run/php/php7.1-fpm.sock,比使用 TCP 以 localhost:9000 的方式性能更好。

    值得一提的是 Ondřej Surý 是 Debian PHP 软件源的官方维护者之一,所以说稳定性和安全性基本上不是问题。

    由于 PHP7.2 是新出的版本势必有不少的兼容性问题,特别是国产的程序建议等待开发者通知再进行升级,一些 PECL 扩展可能也不会及时适配最新版。建议更新前提前做好备份准备。目前已知的是 WordPress 4.9 版本开始支持 PHP7.2。

    相关教程推荐

    添加软件源

    Ubuntu

    安装软件源拓展工具:

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

    添加 Ondřej Surý 的 PHP PPA 源,需要按一次回车:

    add-apt-repository ppa:ondrej/php  

    更新软件源缓存:

    apt update

    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.2:

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

    设置 PHP

    安装完成后,编辑 /etc/php/7.2/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.2/fpm/php.ini 

    管理 PHP

    安装好了先重启一下!

    systemctl restart php7.2-fpm

    更多操作:

    systemctl restart php7.2-fpm #重启
    systemctl start php7.2-fpm #启动
    systemctl stop php7.2-fpm #关闭
    systemctl status php7.2-fpm #检查状态

    更新 PHP

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

    apt update
    apt upgrade -y

    安装更多组件

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

    root@mf88.biz-service:~# apt-cache search php7.2
    
    php-radius - radius client library for PHP
    php-http - PECL HTTP module for PHP Extended HTTP Support
    php-uploadprogress - file upload progress tracking extension for PHP
    php-yaml - YAML-1.1 parser and emitter for PHP
    php-mongodb - MongoDB driver for PHP
    php-apcu - APC User Cache for PHP
    php-imagick - Provides a wrapper to the ImageMagick library
    php-ssh2 - Bindings for the libssh2 library
    php-redis - PHP extension for interfacing with Redis
    php-memcached - memcached extension module for PHP, uses libmemcached
    php-apcu-bc - APCu Backwards Compatibility Module
    php-rrd - PHP bindings to rrd tool system
    php-uuid - PHP UUID extension
    php-memcache - memcache extension module for PHP
    php-zmq - ZeroMQ messaging bindings for PHP
    php-igbinary - igbinary PHP serializer
    php-msgpack - PHP extension for interfacing with MessagePack
    php-geoip - GeoIP module for PHP
    php-tideways - Tideways PHP Profiler Extension
    php-yac - YAC (Yet Another Cache) for PHP
    php-mailparse - Email message manipulation for PHP
    php-oauth - OAuth 1.0 consumer and provider extension
    php-gnupg - PHP wrapper around the gpgme library
    php-propro - propro module for PHP
    php-raphf - raphf module for PHP
    php-solr - PHP extension for communicating with Apache Solr server
    php-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP
    php-gearman - PHP wrapper to libgearman
    php-phalcon - full-stack PHP framework delivered as a C-extension
    php-ds - PHP extension providing efficient data structures for PHP 7
    php-sass - PHP bindings to libsass - fast, native Sass parsing in PHP
    php-lua - PHP Embedded lua interpreter
    libapache2-mod-php7.2 - server-side, HTML-embedded scripting language (Apache 2 module)
    libphp7.2-embed - HTML-embedded scripting language (Embedded SAPI library)
    php7.2-bcmath - Bcmath module for PHP
    php7.2-bz2 - bzip2 module for PHP
    php7.2-cgi - server-side, HTML-embedded scripting language (CGI binary)
    php7.2-cli - command-line interpreter for the PHP scripting language
    php7.2-common - documentation, examples and common module for PHP
    php7.2-curl - CURL module for PHP
    php7.2-dba - DBA module for PHP
    php7.2-dev - Files for PHP7.2 module development
    php7.2-enchant - Enchant module for PHP
    php7.2-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
    php7.2-gd - GD module for PHP
    php7.2-gmp - GMP module for PHP
    php7.2-imap - IMAP module for PHP
    php7.2-interbase - Interbase module for PHP
    php7.2-intl -Internationalisationmodulefor PHP
    php7.2-json - JSON modulefor PHP
    php7.2-ldap - LDAP modulefor PHP
    php7.2-mbstring - MBSTRING modulefor PHP
    php7.2-mysql -MySQLmodulefor PHP
    php7.2-odbc - ODBC modulefor PHP
    php7.2-opcache -ZendOpCachemodulefor PHP
    php7.2-pgsql -PostgreSQLmodulefor PHP
    php7.2-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
    php7.2-pspell - pspell modulefor PHP
    php7.2-readline - readline modulefor PHP
    php7.2-recode - recode modulefor PHP
    php7.2-snmp - SNMP modulefor PHP
    php7.2-soap - SOAP modulefor PHP
    php7.2-sqlite3 -SQLite3modulefor PHP
    php7.2-sybase -Sybasemodulefor PHP
    php7.2-tidy - tidy modulefor PHP
    php7.2-xml - DOM,SimpleXML, WDDX, XML,and XSL modulefor PHP
    php7.2-xmlrpc - XMLRPC-EPI modulefor PHP
    php7.2-zip -Zipmodulefor PHP
    php7.2-xsl - XSL modulefor PHP (dummy)
    php7.2- server-side, HTML-embedded scripting language (metapackage)
    php7.2-sodium - libsodium modulefor PHP
  • 相关阅读:
    tomcatserver解析(五)-- Poller
    最新版OpenWrt编译教程,解决依赖问题
    操作系统2015(四川大学软件学院)
    Kafka专业监控系统Kafka Eagle:支持kerberos认证,并且对接星环TDH集群
    logstash导出ElasticSearch数据到CSV及同步两套ES的数据研究
    hive通过like方式查询多个值
    hadoop balancer平衡集群各节点数据
    Inceptor命令04-表
    Inceptor命令02-命令使用
    Inceptor命令01-表介绍
  • 原文地址:https://www.cnblogs.com/skying555/p/8684640.html
Copyright © 2011-2022 走看看