Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of compiling and installing php7.2 in linux

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how linux compiles and installs php7.2. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Php compilation and installation

Add user

Useradd-r-s / sbin/nologin php-fpm

Download the unzip installation package

Cd / data/pkgwget http://php.net/get/php-7.2.2.tar.gz/from/this/mirror mv mirror php-7.2.2.tar.gztar zxvf php-7.2.2.tar.gzcd php-7.2.2

Installation dependency

Yum-y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libxslt libicu-devel libxslt-devel

Compilation and installation

. / configure\-- prefix=/usr/local/php-7.2.2\-- with-mhash\-- with-openssl\-- with-config-file-path=/usr/local/php-7.2.2/etc\-- disable-short-tags\-- enable-fpm\-- with-fpm-user=php-fpm\-with-fpm-group=php-fpm\-- enable-xml\-- with-libxml-dir\-- enable-bcmath\-- enable-calendar\-- enable- Intl\-- enable-mbstring\-- enable-pcntl\-- enable-shmop\-- enable-soap\-- enable-sockets\-- enable-zip\-- enable-mbregex\-- enable-mysqlnd\-- enable-mysqlnd-compression-support\-- with-mysqli=mysqlnd\-- with-pdo-mysql=mysqlnd\-with-gd\-- enable-ftp\-- with-curl\-- with-xsl\-- with-iconv\-- with-freetype-dir\-- with-jpeg-dir\ -- with-png-dir\-- with-zlib\-- enable-sysvsem\-- enable-inline-optimization\-- with-xmlrpc\-- with-gettextmake-j 4 & & make install

Build a soft chain

Ln-s / usr/local/php-7.2.2/ / usr/local/phpln-s / usr/local/php/bin/php / usr/local/binln-s / usr/local/php/sbin/php-fpm / usr/local/sbin

Set up the user who is running php-fpm

Cd / data/pkg/php-7.2.2cp. / php.ini-development. / php.ini-production / usr/local/php/etccp / usr/local/php/etc/php.ini-development / usr/local/php/etc/php.inicp / usr/local/php/etc/php-fpm.conf.default / usr/local/php/etc/php-fpm.confcp / usr/local/php/etc/php-fpm.d/www.conf.default / usr/local/php/etc/php-fpm.d/www.conf

Build a soft chain

Ln-s / usr/local/php/etc/php.ini / usr/local/etc/ln-s / usr/local/php/etc/php-fpm.conf / usr/local/etc/ln-s / usr/local/php/etc/php-fpm.d/www.conf / usr/local/etc/

Configure environment variables and add global commands

Vim / etc/profilePATH=$PATH:/usr/local/php/binexport PATHsource / etc/profile

Start the php-fpm service

/ usr/local/sbin/php-fpm

Check to see if it starts

Netstat-lnt | grep 9000

Kill php-fpm.

Killall php-fpm

Or

Ps aux | grep php! [clipboard.png] (/ img/bVbi8rC) kill-USR2 29261 Thank you for reading! On the method of linux compilation and installation of php7.2 is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report