、安装php
apt-get install libapache2-mod-php5 php5
报错
E: Package 'libapache2-mod-php5' has no installation candidate
E: Package 'php5' has no installation candidate
解决方法如下:
add-apt-repository ppa:ondrej/php
报错:
The program 'add-apt-repository' is currently not installed. You can install it by typing:
apt install software-properties-common
解决:apt install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install libapache2-mod-php5. php5. php5.-mcrypt php5.-gd php5.-mbstring php-gettext php5.-mysql
安装curl扩展
sudo apt-cache search curl
php-curl - CURL module for PHP [default]
php5.-curl - CURL module for PHP
php7.-curl - CURL module for PHP
php7.-curl - CURL module for PHP
php7.-curl - CURL module for PHP
php7.-curl - CURL module for PHP
apt-get install php5.-curl
/etc/init.d/apache2 restart
sudo apt-cache search redis
如果没有
则需要源码编译安装
安装redis扩展
wget http://pecl.php.net/get/redis-4.2.0.tgz
tar -zxvf redis-4.2.0.tgz
cd redis-4.2.0
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make
make test
make install
编辑php.ini 加入扩展
extension = /usr/local/php5.6/lib/php/extensions/debug-non-zts-20131226/redis.so
发现apt-get install安装的php没有php-config和phpize
解决办法:
apt-get install php5.6-cli
apt-get install php5.6-dev
/usr/bin/php-config
/usr/bin/phpize
刘超 12:09:32
/usr/bin/php5.6
刘超 12:09:52
/usr/bin/php 7.3.10版本
cd /etc/php/5.6/mods-available/
rz redis.ini
cd /etc/php/5.6/apache2/conf.d
ln -s /etc/php/5.6/mods-available/redis.ini 10-redis.ini
手机扫一扫
移动阅读更方便
你可能感兴趣的文章