• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

Ubuntu/Debian安装PHP 7.2教程

建站知识 Liam 1年前 (2019-04-30) 410次浏览 10个评论 扫描二维码
文章目录[隐藏]

适用系统:Ubuntu 16.04/14.04Debian 8/9

添加软件源

Ubuntu

#安装软件源拓展工具 apt -y install software-properties-common  #添加PHP PPA源,需要按一次回车 add-apt-repository ppa:ondrej/php   #更新软件源缓存 apt update 

Debian

#添加GPG wget -O /etc/apt/trusted.gpg.d/php.gpg https://mirror.xtom.com.hk/sury/php/apt.gpg  #安装apt-transport-https apt-get install apt-transport-https  #添加sury软件源 sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'     #更新软件源缓存 apt-get update 

安装PHP 7.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 7.2

安装完成后,编辑/etc/php/7.2/fpm/php.ini替换;cgi.fix_pathinfo=1cgi.fix_pathinfo=0

快捷命令:

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

管理PHP 7.2

安装好了先重启一下!

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 7.2

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

apt update apt upgrade -y 

安装更多组件

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

[email protected]:~# 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 - Internationalisation module for PHP php7.2-json - JSON module for PHP php7.2-ldap - LDAP module for PHP php7.2-mbstring - MBSTRING module for PHP php7.2-mysql - MySQL module for PHP php7.2-odbc - ODBC module for PHP php7.2-opcache - Zend OpCache module for PHP php7.2-pgsql - PostgreSQL module for PHP php7.2-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary) php7.2-pspell - pspell module for PHP php7.2-readline - readline module for PHP php7.2-recode - recode module for PHP php7.2-snmp - SNMP module for PHP php7.2-soap - SOAP module for PHP php7.2-sqlite3 - SQLite3 module for PHP php7.2-sybase - Sybase module for PHP php7.2-tidy - tidy module for PHP php7.2-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP php7.2-xmlrpc - XMLRPC-EPI module for PHP php7.2-zip - Zip module for PHP php7.2-xsl - XSL module for PHP (dummy) php7.2 - server-side, HTML-embedded scripting language (metapackage) php7.2-sodium - libsodium module for PHP 

原文地址:在Ubuntu/Debian下安装PHP7.2


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Ubuntu/Debian安装PHP 7.2教程
喜欢 (3)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(10)个小伙伴在吐槽
  1. Link exchange is nothing else except it is just placing the other person's web site link on your page at appropriate place and other person will also do same in support of you.
    website hosting companies2020-09-01 00:30 回复 Mac OS X | Chrome 63.0.3239.132
  2. Hi, I do think this is a great blog. I stumbledupon it ;) I am going to revisit once again since i have book-marked it. Money and freedom is the best way to change, may you be rich and continue to help other people.
    black mass2020-08-28 17:49 回复 Windows 7 | Internet Explorer 10.0
  3. Greetings! Very useful advice within this post! It is the little changes which will make the most significant changes. Thanks a lot for sharing! y2yxvvfw cheap flights
    cheap flights2020-08-26 22:23 回复 Linux | Firefox浏览器 59.0
  4. Hi there to every , because I am in fact keen of reading this weblog's post to be updated on a regular basis. It consists of fastidious information. 31muvXS cheap flights
    cheap flights2020-08-25 23:24 回复 Windows 7 | Opera 9.80
  5. I really like your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you? Plz respond as I'm looking to create my own blog and would like to find out where u got this from. cheers 3aN8IMa cheap flights
    cheap flights2020-08-25 10:26 回复 Linux | 未知浏览器
  6. You are so cool! I do not suppose I've truly read through something like that before. So nice to discover someone with some unique thoughts on this issue. Seriously.. many thanks for starting this up. This website is one thing that's needed on the web, someone with a little originality! y2yxvvfw cheap flights
    cheap flights2020-08-25 04:50 回复 Mac OS X | Chrome 63.0.3239.84
  7. Howdy I am so delighted I found your blog, I really found you by error, while I was looking on Bing for something else, Nonetheless I am here now and would just like to say thank you for a fantastic post and a all round thrilling blog (I also love the theme/design), I don’t have time to read it all at the minute but I have saved it and also included your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the superb jo. yynxznuh cheap flights
    cheap flights2020-08-24 20:37 回复 Linux | Firefox浏览器 59.0
  8. What's up Dear, are you in fact visiting this web site daily, if so afterward you will absolutely obtain good know-how.
    cheap flights2020-08-24 14:05 回复 Linux | Chrome 65.0.3325.109
  9. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.
    cheap flights2020-08-24 10:45 回复 Linux | Firefox浏览器 2.0.0.6
  10. Howdy! Do you know if they make any plugins to assist with Search Engine Optimization? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good success. If you know of any please share. Many thanks! adreamoftrains content hosting
    adreamoftrains website hosting companies2020-08-12 03:31 回复 Windows XP | 360浏览器 JK