常用的配置参数
1. --prefix=/usr/local/php
指定 php 安装目录
install architecture-independent files in PREFIX 默认 / usr/local
2.--with-config-file-path=PATH
php.ini 的存放位置
- Set the path in which to look for php.ini [PREFIX/lib]
- --with-config-file-scan-dir=PATH
php.ini 的扩展目录
- Set the path where to scan for configuration files
- 3.--with-apxs2=FILE
生成 libphp5.so ,httpd 处理 php 的模块, 需要用到 apache 的 apxs 支持 (需安装了 httpd-devel)
- Build shared Apache 2.0 Handler module. FILE is the optional
- pathname to the Apache apxs tool apxs
- 4.--with-mysql=DIR
加入 mysql 支持, mysql 官方的 Mysql 驱动目录, 如果没设置 DIR 就使用 php 自带的 mysql 驱动 mysqlnd
- Include MySQL support. DIR is the MySQL base directory, if no DIR is passed or the value is
- mysqlnd the MySQL native driver will be used
- 5.--with-mysqli=FILE
加入 mysqli 支持, 没有设置默认是 mysqlnd
Include MySQLi support. FILE is the path to mysql_config. If no value or mysqlnd is passed
as FILE, the MySQL native driver will be used
6.--with-pdo-mysql=DIR
加入 pdo 支持, 默认为自带驱动 mysqlnd
- PDO: MySQL support. DIR is the MySQL base directory If no value or mysqlnd is passed as DIR, the
- MySQL native driver will be used
- 7.--with-mysql-sock=SOCKPATH
指定 mysql 套接字文件位置, 如果没指定则搜索默认位置
- MySQL/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer.
- If unspecified, the default locations are searched
- 8.--enable-sockets
开启 sockets 支持
- Enable sockets support
- 9.--with-libxml-dir=DIR
libxml2 安装位置
- SimpleXML: libxml2 install prefix
- 10.--enable-mbstring
使 php 支持对多字节字符串的处理
Enable multibyte string support
- 11.--with-gd=DIR
- Include GD support. DIR is the GD library base install directory BUNDLED
- 12.--with-curl=DIR
加入 curl 支持
Include cURL support
- --with-mcrypt=DIR Include mcrypt support
- --enable-zip Include Zip read/write support
- --enable-calendar
支持日历转换
- Enable support for calendar conversion
- 16.--with-zlib=DIR
打开 zlib 库支持
Include ZLIB support (requires zlib>= 1.0.9)
17.--enable-bcmath
打开图片大小调整, 用到 zabbix 监控的时候用到了这个模块
- Enable bc style precision math functions
- 18. --enable-soap Enable SOAP support
- 19.--with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI
- 20.--with-freetype-dir=DIR
打开对 freetype 字体库的支持
- GD: Set the path to FreeType 2 install prefix
- 21.--with-jpeg-dir=DIR
打开对 jpeg 图片的支持
- GD: Set the path to libjpeg install prefix
- 22.--with-png-dir=DIR
打开对 png 图片的支持
- GD: Set the path to libpng install prefix
- 23.--without-sqlite3=DIR
自 PHP5.3 起默认启用 SQLite3 扩展, 可以在编译时使用 --without-sqlite3 禁用 SQLite3 扩展
Do not include SQLite3 support. DIR is the prefix to SQLite3 installation directory.
24.--enable-exif
开启图片的元数据支持
Enable EXIF (metadata from images) support
25.--enable-ftp Enable FTP support
- 26.--with-pcre-dir
- FILTER: pcre install prefix
- 27.--disable-fileinfo
fileinfo 在 5.3 以后就被默认安装的, 小内存 VPS 上编译 PHP 会 out of memory
Disable fileinfo support
来源: http://www.bubuko.com/infodetail-2556833.html