温州快建网站建设,如何建立免费网站的步骤,做公司网站的价格,怎么做招聘网站设计CentOS7使用源码安装PHP8教程整理 下载安装包解压下载的php tar源码包安装所需的一些依赖扩展库安装前的配置修改配置文件1、进入php8的安装包 配置环境变量开机自启启动服务创建软连接常见问题1、checking for icu-uc 50.1 icu-io icu-i18n... no2、configure: error: Pa… CentOS7使用源码安装PHP8教程整理 下载安装包解压下载的php tar源码包安装所需的一些依赖扩展库安装前的配置修改配置文件1、进入php8的安装包 配置环境变量开机自启启动服务创建软连接常见问题1、checking for icu-uc 50.1 icu-io icu-i18n... no2、configure: error: Package requirements (oniguruma) were not met:3、configure: error: Cannot find libtidy4、configure: error: Package requirements (libxslt 1.1.0) were not met:5、error: Package requirements (sqlite3 3.7.4) were not met: 下载安装包
有多个安装版本根据自己的需求可以下载php8的各个版本 https://www.php.net/downloads.php wget https://www.php.net/distributions/php-8.3.16.tar.gz 解压下载的php tar源码包
tar -zxvf php-8.3.16.tar.gz安装所需的一些依赖扩展库
yum -y install libxml2* openssl* libcurl* libjpeg* libpng* freetype* libmcrypt*安装前的配置
cd php-8.3.16进入目录执行以下命令
./configure --prefix/usr/local/php8 --with-config-file-path/usr/local/php8/etc --enable-fpm --enable-mysqlnd --with-fpm-usernginx --with-fpm-groupnginx --with-curl --enable-gd --with-tidy --with-gettext --enable-intl --with-kerberos --with-libdirlib64 --with-mysqli --enable-ftp --with-openssl --with-pdo-mysql --with-pdo-sqlite --with-pear --disable-fileinfo --with-xsl --with-zlib --with-bz2 --with-mhash --enable-bcmath --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-calendar --enable-exif看到这张图表示执行成功如果没有就解决error
继续执行以下命令
make make install执行到这里表示执行成功了
修改配置文件
1、进入php8的安装包
cd php-8.3.16/
cp -a php.ini-production /usr/local/php8/etc/php.ini进入安装目录
cd /usr/local/php8/etccp -a php-fpm.conf.default php-fpm.conf cd /usr/local/php8/etc/php-fpm.dcp www.conf.default www.conf
修改www.conf文件
修改端口号9000 为9001因为我有两个php版本还有一个php7
listen 127.0.0.1:9001
listen.owner nginx
listen.group nginx
listen.mode 0666配置环境变量
我这里是两个php版本所以就又增加了一个php8
PATH$PATH:/usr/local/php7/bin:/usr/local/php7/sbin/:/usr/local/php8/bin:/usr/local/php8/sbin/保存环境变量并执行以下命令让其生效
source /etc/profile开机自启
# 源码包 php-8.0.24/sapi/fpmcd ./php-8.3.16/sapi/fpmcp php-fpm.service /usr/lib/systemd/system/php-fpm-8.3.16.service
cp init.d.php-fpm /etc/init.d/php8-fpmchmod x /etc/init.d/php8-fpm
启动服务
service php8-fpm start
service php8-fpm stop
service php8-fpm restart创建软连接
ln -s /usr/local/php8/bin/php /usr/local/bin/php8常见问题
1、checking for icu-uc 50.1 icu-io icu-i18n… no checking for icu-uc 50.1 icu-io icu-i18n... no
configure: error: Package requirements (icu-uc 50.1 icu-io icu-i18n) were not met:No package icu-uc found
No package icu-io found
No package icu-i18n found
解决方案
yum -y install libicu-devel2、configure: error: Package requirements (oniguruma) were not met: checking whether to enable multibyte regex support (requires oniguruma)... yes
checking for oniguruma... no
configure: error: Package requirements (oniguruma) were not met:No package oniguruma found解决方案
yum -y install oniguruma oniguruma-devel3、configure: error: Cannot find libtidy
yum -y install libtidy-devel4、configure: error: Package requirements (libxslt 1.1.0) were not met:
yum -y install libxslt-devel5、error: Package requirements (sqlite3 3.7.4) were not met:
yum install sqlite-devel