php编译参数选项 具体参数含义可以用./configure --help来查看
php编译参数选项
PHP_INSTALL_PATH=/data/web/php
MYSQL_INSTALL_PATH=/data/web/mysql
./configure --prefix=${PHP_INSTALL_PATH} --with-config-file-path=${PHP_INSTALL_PATH}/etc --with-mysql=${MYSQL_INSTALL_PATH} --with-mysqli=${MYSQL_INSTALL_PATH}/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/lib64 --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --enable-pdo --with-pdo-mysql --without-pear
如果加的参数有不支持的,提示比如:configure: WARNING: unrecognized options: --enable-discard-path, --enable-safe-mode, --enable-fastcgi, --enable-force-cgi-redirect
说明上述这些参数废弃了
具体参数含义可以用./configure --help来查看。
列表如下(部分参数未得到解释):
# 指定 php 安装目录
1 | --prefix=/usr/local/php |
# 指定php.ini位置
1 | --with-config-file-path=/usr/local/php/etc |
# mysql安装目录,对mysql的支持
1 | --with-mysql=/usr/local/mysql |
mysqli扩展技术不仅可以调用MySQL的存储过程、处理MySQL事务,而且还可以使访问数据库工作变得更加稳定。
1 | --with-mysqli=/usr/local/mysql/bin/mysql_config |
整合 apache,apxs功能是使用mod_so中的LoadModule指令,加载指定模块到 apache,要求 apache 要打开SO模块
1 | --with-apxs2=/usr/local/apache/bin/apxs |
# 选项指令 --with-iconv-dir 用于 PHP 编译时指定 iconv 在系统里的路径,否则会扫描默认路径。
1 | --with-iconv-dir=/usr/local |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | --with-freetype-dir 打开对freetype字体库的支持 --with-jpeg-dir 打开对jpeg图片的支持 --with-png-dir 打开对png图片的支持 --with-zlib-dir 打开zlib库的支持,用于http压缩传输 --with-libxml-dir 打开libxml2库的支持 --disable-rpath 关闭额外的运行库文件 --enable-bcmath 打开图片大小调整,用到zabbix监控的时候用到了这个模块 --enable-shmop --enable-sysvsem 这样就使得你的PHP系统可以处理相关的IPC函数了。 --enable-inline-optimization 优化线程 --with-curl 打开curl浏览工具的支持 --with-curlwrappers 运用curl工具打开url流 --enable-mbregex --enable-fpm 打上PHP-fpm 补丁后才有这个参数,CGI方式安装的启动程序 --enable-mbstring 多字节,字符串的支持 --with-mcrypt mcrypt算法扩展 --with-mhash mhash算法扩展 --with-gd 打开gd库的支持 --enable-gd-native-ttf 支持TrueType字符串函数库 --with-openssl openssl的支持,加密传输https时用到的 --enable-pcntl freeTDS需要用到的,可能是链接mssql 才用到 --enable-sockets 打开 sockets 支持 --with-xmlrpc 打开xml-rpc的c语言 --enable-zip 打开对zip的支持 --enable-ftp 打开ftp的支持 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | --with-bz2 打开对bz2文件的支持 --without-iconv 关闭iconv函数,字符集间的转换 --with-ttf 打开freetype1.*的支持,可以不加了 --with-xsl 打开XSLT 文件支持,扩展了libXML2库 ,需要libxslt软件 --with- gettext 打开gnu 的 gettext 支持,编码库用到 --with-pear 打开pear命令的支持,PHP扩展用的 --enable-calendar 打开日历扩展功能 --enable-exif 图片的元数据支持 --enable-magic-quotes 魔术引用的支持 --disable-debug 关闭调试模式 --with-mime-magic=/usr/share/file/magic.mime 魔术头文件位置 |
CGI方式安装才用的参数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | --enable-fastCGI 支持fastcgi方式启动PHP --enable-force-CGI-redirect 重定向方式启动PHP --with-ncurses 支持ncurses 屏幕绘制以及基于文本终端的图形互动功能的动态库 --with-gmp 应该是支持一种规范 --enable-dbase 建立DBA 作为共享模块 --with-pcre-dir=/usr/local/bin/pcre-config perl的正则库案安装位置 --disable-dmalloc --with-gdbm dba的gdbm支持 --enable-sigchild --enable-sysvshm --enable-zend-multibyte 支持zend的多字节 --enable-wddx --enable-soap |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!