Home > Backend Development > PHP Tutorial > Detailed explanation of the sample code for installing PHP7, APCu, APCu_bc on Ubuntu

Detailed explanation of the sample code for installing PHP7, APCu, APCu_bc on Ubuntu

黄舟
Release: 2023-03-07 07:48:01
Original
4421 people have browsed it

InstallationPHP7.0

sudo add-apt-repository ppa:ondrej/php  
sudo apt-get update  
sudo apt-get install -y php7.0  
  
sudo apt-get install 
php7.0 
php7.0-dev 
php7.0-mysql 
php7.0-curl 
php7.0-cli 
php7.0-common 
php7.0-curl 
php7.0-fpm 
php7.0-gd 
php7.0-intl 
php7.0-json 
php7.0-memcached 
php7.0-mysqlnd 
php7.0-readline 
php7.0-zip
Copy after login

Already installed PHP upgraded to php7.0

sudo add-apt-repository ppa:ondrej/php  
  
注:  
      如果提示:sudo: add-apt-repository: command not found 执行:  
      sudo apt-get install software-properties-common
Copy after login

UpdateAll programs

sudo apt-get update
Copy after login

DeletePrevious PHP5 extensions

sudo apt-get purge php5-*
Copy after login

Install all updated data

sudo apt-get upgrade
Copy after login

Install PHP7 and previously deleted extensions

sudo 
apt-get install 
php7.0 
php7.0-dev 
php7.0-mysql 
php7.0-curl 
php7.0-cli 
php7.0-common 
php7.0-curl 
php7.0-fpm 
php7.0-gd 
php7.0-intl 
php7.0-json 
php7.0-memcached 
php7.0-mysqlnd 
php7.0-readline 
php7.0-zip
Copy after login

Configure the time zone in /etc/php7/cli/php.ini

date.timezone = Asia/Shanghai
Copy after login

Install apcu, apcu_bc extensions

sudo apt-get install php-apcu php-apcu-bc
Copy after login

When the above command cannot be installed, you need to manually download the installation package and install it yourself:

// 下载安装包  
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/php-apcu/php-apcu_5.1.7+4.0.11-2_amd64.deb  
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/php-apcu-bc/php-apcu-bc_1.0.3-2_amd64.deb  
  
// 安装软件  
sudo dpkg -i php-apcu_5.1.7+4.0.11-2_amd64.deb  
sudo dpkg -i php-apcu-bc_1.0.3-2_amd64.deb
Copy after login

php.ini configuration apcu

打开 /etc/php/7.0/mods-available/apcu.ini  
添加代码:  
  
apc.enable_cli=On
Copy after login

The above is the detailed content of Detailed explanation of the sample code for installing PHP7, APCu, APCu_bc on Ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template