Home > Backend Development > PHP7 > Introducing the installation of php7 and php7 redis extension on ubuntu

Introducing the installation of php7 and php7 redis extension on ubuntu

coldplay.xixi
Release: 2023-02-17 18:36:01
forward
3088 people have browsed it

PHP7The column introduces how to install php7 nginx mysql environment in ubuntu

Introducing the installation of php7 and php7 redis extension on ubuntu

Recommended (Free): PHP7

##1. First add nginx_signing.key:

wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
Copy after login
2. Install nginx:

sudo apt-get update
sudo apt-get install nginx
Copy after login
3. Install mysql:

sudo apt-get install mysql-server-5.6 mysql-client-5.6
Copy after login
4. Add PPA:

sudo apt-get install python-software-properties software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Copy after login
5. Install php7 and php7 extensions

sudo apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-curl php7.0-cli php7.0-mcrypt php7.0-mbstring php7.0-dom php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php-gettext
Copy after login
6. Install php7redis extension:

cd /etc
wget https://github.com/phpredis/phpredis/archive/php7.zip -O phpredis.zip
unzip -o /etc/phpredis.zip && mv /etc/phpredis-* /etc/phpredis && cd /etc/phpredis && phpize  
./configure && make && sudo make install
Copy after login
above It seems to have been officially deleted. If it doesn't work, there is another way

cd /etc
sudo git clone https://github.com/nicolasff/phpredis  
cd phpredis  
sudo git checkout php7  
sudo /usr/local/php7/bin/phpize  
./configure --with-php-config=/usr/local/php7/bin/php-config  
make && make install
Copy after login
If the above is successful, enter extension=redis.so

in /etc/php/7.0/mods-available/redis.ini. The phpredis extension is connected to php7

sudo ln -s /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/fpm/conf.d/redis.ini
sudo ln -s /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/cli/conf.d/redis.ini
Copy after login
If it is apache, add extension=/tmp/phpredis/modules/redis.so

at the end of /etc/php/7.0/apache2/php.ini
Restart php and nginx

sudo service php7.0-fpm restart
sudo service nginx restart
Copy after login

The above is the detailed content of Introducing the installation of php7 and php7 redis extension on ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
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