---
title: "emerge PHP 添加模块 比如非默认模块mysql"
author: "iammonster"
date: "2010-04-22T11:09:31Z"
tags: []
categories: ["编程语言"]
slug: "emerge-php-mysql"
draft: false
lastmod: "2010-04-22T12:45:21Z"
id: 650210
url: "https://jiajun.iteye.com/blog/650210"
---

```
// 查看默认USE变量

emerge --pretend --verbose php

[ebuild   R   ] dev-lang/php-5.2.13  USE="berkdb bzip2 cli crypt gdbm iconv ipv6 ncurses nls pcre readline reflection session spl ssl unicode zlib -adabas -apache2 -bcmath -birdstep -calendar -cdb -cgi -cjk -concurrentmodphp -ctype -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gmp -hash -imap -inifile -interbase -iodbc (-java-external) -json -kerberos -kolab -ldap -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -spell -sqlite -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -truetype -wddx -xml -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip" 

//添加模块mysql

比如mysql不是默认配置的，那么想增加mysql模块怎么办呢？把mysql前面的-去掉就可以了。方法如下：

USE=" ... " emerge php

...内容：拷贝上面的USE="" 把-mysql修改为mysql


另外：参考官方文档USE的使用 http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml?part=2&chap=2
```

 

//===========================安装非内置模块=======================

```
// 比如安装 pecl-memcache

emerge  dev-php5/pecl-memcache

php -m
是不是有了呢？ 呵呵

//再比如安装 eaccelerator
 USE="session apache2 -contentcache -debug -disassembler -inode -sharedmem" emerge  dev-php5/eaccelerator
```