centos 更新php、设置xdebug

来源:互联网 发布:法国vb是什么牌子 编辑:程序博客网 时间:2024/05/06 15:50

1. 查询当前所安装的php包以方便卸载

rpm -qa|grep php

2.按顺序卸载以上列出的php包

# rpm -e php-mysql-5.1.6-27.el5_5.3 
# rpm -e php-pdo-5.1.6-27.el5_5.3 
# rpm -e php-xml-5.1.6-27.el5_5.3 
# rpm -e php-cli-5.1.6-27.el5_5.3 
# rpm -e php-gd-5.1.6-27.el5_5.3 
# rpm -e php-common-5.1.6-27.el5_5.3

3.检查是否卸载干净

php -v

4.获取最新php安装包源 (for centos 6.X)

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

5.安装php和phpopcache

yum install php55w php55w-opcache

6.安装所需扩展包

yum -y install php55w-mcrypt php55w-pdo php55w-pecl-xdebug php55w-soap php55w-mysql php55w-gd php55w-common

7.配置xdebug,在/etc/php.d/xdebug.ini 中

zend_extension="/usr/lib/php/modules/xdebug.so"
zend_extension_ts =/usr/lib64/php/modules/xdebug.so

[Xdebug]
;xdebug.profiler_enable=off
;xdebug.auto_trace=off
;xdebug.var_display_max_depth=10
xdebug.remote_enable=1
//xdebug.remote_handler=dbgp
//xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.idekey="phpstorm";//xdebug key for chrome,firefox,phpstrom

8.配置php.ini

date.timezone = Asia/Shanghai

short_open_tag = On

display_errors = On

html_errors = On

post_max_size = 128M

upload_max_filesize = 128M

0 0