鲲鹏云服务器源码安装php7

网友投稿 560 2022-05-28

PHP即“超文本预处理器”,是一种通用开源脚本语言。PHP是在服务器端执行的脚本语言,与C语言类似,是常用的网站编程语言。PHP独特的语法混合了C、Java、Perl以及 PHP 自创的语法。利于学习,使用广泛,主要适用于Web开发领域。

云服务器要求

本文以KC1实例测试,配置如表 云服务器配置所示。

项目

说明

规格

kc1.large.2 | 2vCPUs | 4GB

磁盘

系统盘:高IO(40GB)

操作系统要求

操作系统要求如表 操作系统要求所示。

项目

说明

下载地址

CentOS

7.6

在公共镜像中已提供。

Kernel

4.14.0-115

在公共镜像中已提供。

安装相关依赖

yum install libxml2-devel openssl openssl-devel curl curl-devel libjpeg libjpeg-devel freetype freetype-devel libpng libpng-devel libxslt libxslt-devel pcre pcre-devel bzip2 bzip2-devel  httpd-devel libzip libzip-devel -y

获取“php7.2.13”源码包。

cd /usr/local/src

wget https://www.php.net/distributions/php-7.2.13.tar.gz

鲲鹏云服务器源码安装php7

解压软件包

tar -zxvf php-7.2.13.tar.gz && cd php-7.2.13

生成Makefile文件

./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/php/bin --sbindir=/usr/local/php/sbin --includedir=/usr/local/php/include --libdir=/usr/local/php/lib/php --mandir=/usr/local/php/php/man --with-config-file-path=/usr/local/php/etc --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mhash --with-openssl --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-freetype-dir --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --without-gdbm --enable-fileinfo --with-apxs2=/usr/bin/apxs --disable-fileinfo

编译php

make -j4  && make install

建立软连接

ln -s /usr/local/php/sbin/php-fpm /usr/local/bin

ln -s /usr/local/php/bin/php /usr/bin/php

查看php版本信息

php -v

回显类似如下信息说明php编译成功

PHP 7.3.15 (cli) (built: Mar  7 2020 19:47:46) ( NTS )Copyright (c) 1997-2018 The PHP GroupZend Engine v3.3.15, Copyright (c) 1998-2018 Zend Technologies

鲲鹏

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:《Java并发编程的艺术》 —1.3 资源限制的挑战
下一篇:《Linux系统安全:纵深防御、安全扫描与入侵检测 》 —1.2.2 常见的安全威胁来源
相关文章