当前位置:网站首页>银河麒麟V10 SP2 x86编译安装 PHP7.4
银河麒麟V10 SP2 x86编译安装 PHP7.4
2022-07-29 20:43:00 【人间小苦瓜_】
目录
前言
PHP不断发展,他们刚刚发布了最新PHP 7.4更新。 正如我们在过去PHP 7版本中所证明的那样,性能和速度在不断提高。 预加载是最令人激动的新更新之一。 由于简化了常见的代码行,因此可以加快脚本执行速度,并使代码更清洁,更快。
一、PHP是什么?
PHP是www上的重要元素,并且在超过79%的网站中使用。 诸如Facebook,Wikipedia,WordPress等知名网站都在使用PHP。 当查看运行PHP的WordPress网站并比较PHP 5和7时,我们可以看到速度提高了两倍。在使用最新PHP版本的情况下– WordPress驱动的网站获得了最大的收益。
二、使用步骤
1.下载安装包
wget https://www.php.net/distributions/php-7.4.16.tar.gz2.准备PHP相关依赖包
2.1安装oniguruma-6.9.4
[[email protected] mysqlpackage]# wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz
[[email protected] mysqlpackage]# tar -xvf oniguruma-6.9.4.tar.gz
[[email protected] mysqlpackage]# cd oniguruma-6.9.4/
[[email protected] mysqlpackage]#./autogen.sh && ./configure --prefix=/usr --libdir=/lib64
[[email protected] mysqlpackage]# make && make install2.2.安装libmcrypt
[[email protected] mysqlpackage]# wget https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
#安装libmcrypt
[[email protected] mysqlpackage]# tar xf libmcrypt-2.5.8.tar.gz
[[email protected] mysqlpackage]# cd libmcrypt-2.5.8
[[email protected] mysqlpackage]# ./configure --prefix=/usr/local/libmcrypt
[[email protected] mysqlpackage]# make && make install2.3.安装依赖环境
[[email protected] mysqlpackage]# yum -y install libtool sqlite-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel readline readline-devel libxslt libxslt-devel2.4 开始编译PHP
[[email protected] tools]# tar -xvf php-7.4.16.tar.gz
[[email protected] tools]# cd php-7.4.16
#编辑PHP的配置项
./configure --prefix=/usr/local/php \
--with-config-file-path=/etc \
--enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx \
--enable-inline-optimization --disable-debug --disable-rpath \
--enable-shared --enable-soap --with-xmlrpc \
--with-openssl --with-mhash --with-sqlite3 \
--with-zlib --enable-bcmath --with-iconv --with-bz2 \
--enable-calendar --with-curl --with-cdb --enable-dom \
--enable-exif --enable-fileinfo --enable-filter \
--enable-ftp --with-openssl-dir --with-zlib-dir \
--enable-gd-jis-conv --with-gettext --with-gmp --with-mhash \
--enable-json --enable-mbstring --enable-mbregex \
--enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
--with-zlib-dir --with-pdo-sqlite --with-readline --enable-session \
--enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg \
--enable-sysvsem --enable-sysvshm --with-xsl \
--enable-mysqlnd-compression-support --with-pear \
--enable-opcache --disable-fileinfo
#安装
[[email protected] tools]# make -j 3 && make install 3.修改配置添加快捷启动
#添加环境变量
echo "export PATH=$PATH:/usr/local/php/bin" >> /etc/profile
source /etc/profile
#准备配置文件
cp php.ini-production /usr/local/php/etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
ln -s /usr/local/php/etc/ /etc/php
#修改 /usr/local/php/etc/php-fpm.conf 运行用户和组改为nginx
chown nginx.nginx /usr/local/php/etc/php-fpm.conf
chown -R nginx.nginx /etc/php
#禁用PHP功能
sed -i "s#disable_functions =#disable_functions =\"passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd,wnam,posix_getpwuid, posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname\"#" /etc/php/php.ini
#支持mysql
sed -i "s#pdo_mysql.default_socket=#pdo_mysql.default_socket=/var/lib/mysql/mysql.sock
#" /etc/php/php.ini
sed -i "s#mysqli.default_socket =#mysqli.default_socket =/var/lib/mysql/mysql.sock
#" /etc/php/php.ini
#设置开机自启,并启动
cp /opt/tools/php-7.4.16/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
chkconfig php-fpm on
systemctl start php-fpm总结
php依赖环境较为复杂,如果在编译过程中出现报错,可以根据提示,安装对应依赖即可
边栏推荐
- 240. Searching 2D Matrix II
- A dish hold up valuations billions of mt. Pickled fish, can move beyond the edge food safety?
- LeetCode 0593. 有效的正方形
- 南信大提出TIPCB,一个简单但有效的用于基于文本的人员搜索的基于部分的卷积baseline
- 全自动化机器学习建模!效果吊打初级炼丹师!
- 优惠券系统设计思想
- First thoughts on the first attempt to avoid killing without a file (Part 1)
- 分布式限流 redission RRateLimiter 的使用及原理
- 嵌入式分享合集24
- 系列(jupyter自动保存失败)
猜你喜欢
![[ACTF2020 新生赛]Exec 1](/img/1e/a3c19d514207e6965d09c66b86e519.png)
[ACTF2020 新生赛]Exec 1

诺氟沙星-DNA复合物|半乳糖化脂质体-聚阳离子-DNA复合物|注意事项

leetcode-593:有效的正方形

ALBERT: A Lite BERT for Self-supervised Learning of Language Representations

Panorama Tutorial丨How to shoot sunrise and sunset scenes in VR panoramic shooting?

4. Implementation Guide for GET_ENTITYSET Method of SAP ABAP OData Service Data Provider Class

UDP协议详解

Come in now!!!Take you to know the basic data types of C language

The demand for VR live broadcast marketing is increasing, and the data module is paving the way for us

如何进入董事会:给CIO的十条建议
随机推荐
Panorama Tutorial丨How to shoot sunrise and sunset scenes in VR panoramic shooting?
第二好PyTorch新手课程;论文写作指南;使用µGo语言开发迷你编译器;超高效使用Transformer的扩展库;前沿论文 | ShowMeAI资讯日报
SAP ABAP OData 服务 Data Provider Class 的 GET_ENTITYSET 方法实现指南试读版
Liu Genghong, boys and girls, come here!Sports data analysis and mining!(with a full set of code and data sets)
亚马逊登录参数metadata1,encryptedPwd逆向分析
博世集团启动量子数字孪生计划
MySQL Data Query - Simple Query
7 行代码搞崩溃 B 站,原因令人唏嘘!
进程间六种通信方式
高通WLAN框架学习(31)-- Power save
OneNote tutorial, how to take notes in OneNote?
怎么实现您的个人知识库?
全景教程丨VR全景拍摄如何拍摄日出和日落的场景?
【593. 有效的正方形】
Cobaltstrike和BurpSuite桌面快捷配置
Kotlin - Coroutine Scope CoroutineScope, Coroutine Builder CoroutineBuilder, Coroutine Scope Function CoroutineScope Functiom
刘畊宏男孩女孩看过来!运动数据分析挖掘!(附全套代码和数据集)
R language for airbnb data nlp text mining, geography, word cloud visualization, regression GAM model, cross-validation analysis
基于PaddleSpeech搭建个人语音听写服务
系列(jupyter自动保存失败)