php编译安装
短信预约 -IT技能 免费直播动态提醒
1.安装依赖 (我也是百度搜索的)
yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libzip-devel pcre-devel sqlite-devel.x86_64
安装oniguruma库
wget https://github.com/kkos/oniguruma/releases/download/v6.9.5_rev1/onig-6.9.5-rev1.tar.gz -O onig-6.9.5.tar.gz# 解压 并且进入目录 ->指定路径 ./configure --prefix=/usr --libdir=/lib64make && make install
php官网进行下载,下载要安装的版本
–prefix=/usr/local/php7 //php安装目录–with-config-file-path=/usr/local/php7/etc //php配置目录–with-config-file-scan-dir=/usr/local/php7/etc/php.d //php.d目录--with-fpm-user=nginx \ 指定用户--with-fpm-group=nginx \ 指定组# 官网地址https://www.php.net/downloads.php# 解压tar xf php-7.4.32.tar.gz# 进入目录# 编译安装./configure --prefix=/usr/local/php7 \--with-config-file-path=/usr/local/php7/etc \--with-config-file-scan-dir=/usr/local/php7/etc/php.d \--enable-mysqlnd \--with-mysqli \--with-pdo-mysql \--enable-fpm \--with-fpm-user=nginx \--with-fpm-group=nginx \--with-gd \--with-iconv \--with-zlib \--enable-xml \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--enable-mbregex \--enable-mbstring \--enable-ftp \--with-openssl \--enable-pcntl \--enable-sockets \--with-xmlrpc \--enable-zip \--enable-soap \--without-pear \--with-gettext \--enable-session \--with-curl \--with-jpeg-dir \--with-freetype-dir \--enable-opcache# 安装的时候非常慢make && make install
配置php
#进入目录 cd /root/php-7.4.32cp php.ini-development /usr/local/php7/etc/php.inicp sapi/fpm/www.conf /usr/local/php7/etc/php-fpm.d/www.confcp sapi/fpm/php-fpm.conf /usr/local/php7/etc/php-fpm.confcp sapi/fpm/init.d.php-fpm.in /etc/init.d/php-fpm
修改 /etc/init.d/php-fpm
vim /etc/init.d/php-fpmphp_fpm_BIN=/usr/local/php7/sbin/php-fpmphp_fpm_CONF=/usr/local/php7/etc/php-fpm.confphp_fpm_PID=/usr/local/php7/var/run/php-fpm.pid
来源地址:https://blog.csdn.net/qq_41961206/article/details/127242842
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341