---
title: "Drupal配置"
author: "jontan"
date: "2014-01-21T15:10:23Z"
tags: []
categories: ["Web前端"]
slug: "drupal"
draft: false
lastmod: "2014-01-21T15:10:23Z"
id: 2007785
url: "https://summary.iteye.com/blog/2007785"
---

**Xdebug 配置**

**vim php.ini  添加**

```
[XDebug]
;zend_extension = "/var/lib/xbug/php_xdebug.dll"
;开启自动跟踪
;zend_extention="/usr/lib64/php/modules/xdebug.so"
zend_extension="/var/local/xdebug/modules/xdebug.so"
xdebug.auto_trace = On
;;开启异常跟踪
xdebug.show_exception_trace = On
;;开启远程调试自动启动
xdebug.remote_autostart = On
;;开启远程调试
xdebug.remote_enable = On
;;收集变量
xdebug.collect_vars = On
;;收集返回值
xdebug.collect_return = On
;;收集参数
xdebug.collect_params = On
xdebug.trace_output_dir="/tmp"
xdebug.profiler_enable=On
xdebug.profiler_output_dir="/tmp"
xdebug.remote_host=10.243.119.41
;xdebug.remote_host=192.168.1.102
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
```

 

**Drupal的高速缓存配置APC**

**APC安装**  
yum install pcre pcre-devel  
pecl install apc

 

**PHP加载APC**  
vi /etc/php.ini  
加入内容  
extension = apc.so  
apc.enabled = 1  
apc.shm\_size = 32  
apc.include\_once\_override = 1  
apc.mmap\_file\_mask = /tmp/apc.XXXXXX

 

**APC调试**  
APC自带一个PHP调试程序，可以查询APC运行情况

（附件为查询界面）

搜索apc.php  
\# locate apc.php

具体请访问  
[http://www.vpsee.com/2009/07/integrating-apc-with-php-on-vps/](http://www.vpsee.com/2009/07/integrating-apc-with-php-on-vps/)

 

**Drupal整合APC**  
drupal6可以用Cache Router来整合APC  
[http://drupal.org/project/cacherouter](http://drupal.org/project/cacherouter)  
drupal7可以用APC module  
[http://drupal.org/project/apc](http://drupal.org/project/apc)

 

安装Cache Router后按照官方文档进行配置，engine有apc, db, file, memcache, xcache可选。  
apc, memcache, xcache都是PHP上较主流的高速缓存服务，需要服务器支持。现在我们需要让它使用APC，所以把engine设为apc  
然后开启drupal的cache，APC cache就会生效。