Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian php5.4升级php5.6 #77

Open
ionepub opened this issue Sep 12, 2018 · 0 comments
Open

Debian php5.4升级php5.6 #77

ionepub opened this issue Sep 12, 2018 · 0 comments
Labels

Comments

@ionepub
Copy link
Owner

ionepub commented Sep 12, 2018

写入php5.6的源:

echo "deb http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
echo "deb-src http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list

由于是第三方源,在使用前需要添加到系统信任中:

cd /tmp
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -

接着更新apt repository,并安装PHP,注意提前备份配置文件

aptitude update
aptitude install php5-cli php5-fpm

安装过程中,会提示你某些包会被卸载,需要记下,比如我在安装的时候提示这些都被卸载:

1)     libapache2-mod-php5
2)     php5-curl
3)     php5-gd
4)     php5-mcrypt
5)     php5-memcache
6)     php5-mysql
7)     php5-redis

安装完成之后,查看PHP版本应该已经升级到php5.6了。

过程中可能遇到的问题

1、基于gd库的图形验证码图片不显示了或MySQL数据库无法连接了

在安装过程中,有些包因为版本问题被卸载了,重新装一下。

按照安装过程中提示的被卸载的包,都重装一下:

apt-get install libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-memcache php5-mysql php5-redis

模块安装完之后都需要重新启动Apache服务:

service apache2 restart

2、访问php页面,直接显示源码,而不解析

找到Apache模块目录,把PHP相关模块启用:

cd /etc/apache2/mods-available/
ls | grep php5

image

将这些模块都复制到 mods-enabled 目录中:

# 这边简单逐一复制
cp php5.conf ../mods-enabled/
cp php5.load ../mods-enabled/

重启Apache:

service apache2 restart

日行一记

@ionepub ionepub added the 系统 label Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant