php源码编译的参数解释,php源码安装编译参数

如下:

./configure --prefix=/usr/local/php56 --htmldir=/usr/local/php56/doc --with-config-file-path=/usr/local/php56/etc/ --with-pear --enable-re2c-cgoto --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-fpm-acl --enable-phpdbg --enable-phpdbg-debug --enable-debug --enable-sigchild --enable-libgcc --with-openssl --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-exif --enable-ftp --with-gd --with-pcre-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-mhash --with-gettext --enable-intl --enable-mbstring --with-mcrypt --with-mysql --enable-opcache --enable-pcntl' --with-pdo-mysql --with-zlib-dir --enable-shmop --with-libedit --with-readline --enable-soap --with-libxml-dir --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-tidy --with-xmlrpc --with-iconv-dir --with-xsl --enable-zip --enable-mysqlnd --with-zend-vm=GOTO --enable-zend-signals --with-tsrm-pthreads --with-curl --with-jpeg-dir --with-png-dir --with-xpm-dir

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安装 PHP 需要先安装一些依赖库和工具,可以使用以下命令安装: ``` sudo dnf install epel-release sudo dnf update sudo dnf install -y gcc gcc-c++ make automake autoconf libtool re2c bison libxml2-devel libjpeg-devel libpng-devel libXpm-devel freetype-devel gmp-devel libmcrypt-devel readline-devel libxslt-devel libtidy-devel libcurl-devel libicu-devel libzip-devel oniguruma-devel ``` 安装完成后,可以从 PHP 官方网站下载最新的 PHP 源码包进行安装。假设下载的是 PHP 8.0.11 版本: ``` curl -O https://www.php.net/distributions/php-8.0.11.tar.gz tar -zxvf php-8.0.11.tar.gz cd php-8.0.11 ``` 接着,执行以下命令进行编译安装: ``` ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mbstring --with-iconv --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-gd --with-jpeg --with-png --with-zlib --with-freetype --enable-gd-jis-conv --with-xpm --with-gettext --with-xmlrpc --with-xsl --with-tidy --with-mcrypt --enable-sockets --enable-soap --with-openssl --with-mhash --enable-opcache --enable-zip --with-zip --with-pear --enable-bcmath --enable-calendar --enable-exif --with-imap --with-imap-ssl --enable-intl --with-icu-dir=/usr --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-xml --enable-wddx --with-readline --enable-debug make && make install ``` 其中,`--prefix` 指定安装目录,`--with-config-file-path` 指定配置文件的路径,`--enable-fpm` 启用 PHP-FPM,`--with-fpm-user` 和 `--with-fpm-group` 指定 PHP-FPM 运行用户和用户组,其余参数根据需要自行添加或修改。 安装完成后,可以将 PHP 的可执行文件路径 `/usr/local/php/bin` 添加到环境变量中,或者通过软链接将其添加到 `/usr/bin` 目录下,以便全局使用: ``` ln -s /usr/local/php/bin/php /usr/bin/php ``` 最后,启动 PHP-FPM 服务: ``` cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp sapi/fpm/php-fpm.service /etc/systemd/system/ systemctl enable php-fpm.service systemctl start php-fpm.service ``` 安装完成后,可以通过 `php -v` 命令查看 PHP 版本信息。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值