企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 一、概述 生产环境务必采用linux部署; 因此,以下的说明都是基于linux; ## 二、下载及安装 php的配置参数,跟它的版本有关,下面以php7.2.33为例; 1、新建安装php的根目录: ``` mkdir /usr/local/php ``` 进入该目录; ``` cd /usr/local/php ``` 2、下载安装介质 ``` wget https://www.php.net/distributions/php-7.4.10.tar.gz ``` 3、解压 ``` tar zxvf php-7.4.10.tar.gz ``` 4、配置:进入解压后的php目录,执行以下安装命令: ``` ./configure --prefix=/usr/local/php --with-curl --with-gd --with-gettext --with-iconv-dir=/usr/local --with-kerberos --with-libdir=lib64 --enable-libxml --with-mysqli --with-openssl --with-pdo-mysql --with-pdo-sqlite --with-pear --enable-sockets --with-mhash --with-ldap-sasl --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip --with-config-file-path=/usr/local/php/etc -with-bz2 --enable-inline-optimization --enable-sysvsem ``` 看到下面的内容,就表明配置成功了: ![](../../../../images/screenshot_1599747706957.png) 还有可能,结果是这样的: ![](../../../../images/screenshot_1601365723616.png) 虽然成功了,但有警告; >[danger] 这里需要特别留意,虽然成功了,但有告警信息的话,一般就是说明配置的参数无效,那么就需要排查,否则,会导致必要的扩展或特性没有安装成功; 5、安装 ``` make && make install ``` 看到下面的内容,就表明安装完成了; ![](https://img.kancloud.cn/59/5a/595ab0d821b7e3749ddae46ce824e24e_828x230.png) ## 三、安装过程中的问题: 遇到问题后,先安装缺的包,然后再重复执行上面的配置命令;可能遇到的问题如下: Package 'libxml-2.0', required by 'virtual:world', not found: ``` yum install libxml2-devel ``` Package 'sqlite3', required by 'virtual:world', not found: ``` yum install sqlite-devel ``` Please reinstall the BZip2 distribution; ``` yum install bzip2 bzip2-devel ``` Package 'libcurl', required by 'virtual:world', not found; ~~~ yum install libcurl-devel ~~~ Package 'libpng', required by 'virtual:world', not found; ~~~ yum install libpng-devel ~~~ Package 'libjpeg', required by 'virtual:world', not found; ~~~ yum install libjpeg-devel ~~~ Package 'freetype2', required by 'virtual:world', not found; ~~~ yum install freetype-devel ~~~ Package 'oniguruma', required by 'virtual:world', not found; ~~~ wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz ; tar -zxvf oniguruma-6.9.4.tar.gz; cd oniguruma-6.9.4/; ./autogen.sh && ./configure --prefix=/usr; make && make install; ~~~ Package 'libxslt', required by 'virtual:world', not found; ~~~ yum install libxslt-devel ~~~ Package 'libzip', required by 'virtual:world', not found; ~~~ yum install libzip-devel ~~~ configure: error: Cannot find OpenSSL's <evp.h> ``` yum install openssl openssl-devel ```