当前位置:网站首页>银河麒麟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依赖环境较为复杂,如果在编译过程中出现报错,可以根据提示,安装对应依赖即可
边栏推荐
- SAP ABAP OData 服务 Data Provider Class 的 GET_ENTITYSET 方法实现指南试读版
- 7 行代码搞崩溃 B 站,原因令人唏嘘!
- 《张卫国的夏天》欢乐来袭,黄磊、刘奕君携手演绎“冤种”兄弟
- Durable rules (persistent rules engine) learning notes
- Cooler Navigation helps you shop easily in shopping malls without confusion
- 关于论青少年尽早学少儿编程之说
- 从专业角度分析国内创客教育发展
- Baidu internship students late night fun: originally giant is this kind of life
- 如何进入董事会:给CIO的十条建议
- 240. 搜索二维矩阵 II
猜你喜欢
随机推荐
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
940. 不同的子序列 II
Qualcomm WLAN framework learning (31) -- Power save
【593. Valid Square】
1. Promise usage in JS, 2. The concept and usage of closures, 3. The difference between the four methods and areas of object creation, 4. How to declare a class
容器网络硬核技术内幕 (26) 知微知彰,知柔知刚 (下)
378. The Kth Smallest Element in an Ordered Matrix
Unity determines whether a string can be converted to float type
点击返回顶部
赶紧进来!!!带你认识C语言基本数据类型
Panorama Tutorial丨How to shoot sunrise and sunset scenes in VR panoramic shooting?
The difference between analog, digital and switching
关于云计算的海量数据存储模型[通俗易懂]
刚重装的win7系统不能上网(深度系统安装步骤)
LeetCode 0144. 二叉树的前序遍历:二叉树必会题
Fully automated machine learning modeling!The effect hangs the primary alchemist!
从专业角度分析国内创客教育发展
三品牌下半年将带来多款新品,东风日产将迎来“产品大潮”
干货!联邦学习中的合作均衡
Baidu internship students late night fun: originally giant is this kind of life









