In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to install PHP7.1 in CentOS7". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install PHP7.1 in CentOS7.
1. First install the dependency package: yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-deve zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl Gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel2. Download the PHP package and unzip it: 1 wget http://php.net/distributions/php-7.1.0.tar.gz2 tar-zxvf php-7.1.0.tar.gz3 cd php-7.1.03. Compilation and installation Various error reports may occur during compilation:. / configure\-- prefix=/usr/local/php\-- with-config-file-path=/etc\-- enable-fpm\-- enable-inline-optimization\-- disable-debug\-- disable-rpath\-- enable-shared\-- enable-soap\-- with-libxml-dir\-- with-xmlrpc\-- with-openssl\-- with-mcrypt\-- with-mhash\-- with-pcre-regex \-- with-sqlite3\-- with-zlib\-- enable-bcmath\-- with-iconv\-- with-bz2\-- enable-calendar\-- with-curl\-- with-cdb\-- enable-dom\-- enable-exif\-- enable-fileinfo\-- enable-filter\-- with-pcre-dir\-enable-ftp\-with-gd\-with-openssl-dir\-with-jpeg-dir\-with-png-dir\-- with -zlib-dir\-- with-freetype-dir\-- enable-gd-native-ttf\-- enable-gd-jis-conv\-- with-gettext\-- with-gmp\-- with-mhash\-- enable-json\-- enable-mbstring\-- enable-mbregex\-- enable-mbregex-backtrack\-- with-libmbfl\-- with-onig\-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\-- enable-wddx\-- with-libxml-dir\-- with-xsl\-- enable-zip\-enable-mysqlnd-compression-support\-- with-pear\-- enable-opcache
Copy all the above code and execute it at once.
4. Install: make & & make install after successful compilation
Note: make: * [sapi/cli/php] error 1 error may occur during compilation. Solution:
1). $vim Makefile open, Makefile file, and add-liconv at the end of the EXTRA_LIBS, such as: XTRA_LIBS =-lcrypt-lz-lresolv-lcrypt-lreadline-ltermcap-lmcrypt-lltdl-lpng-lz-ljpeg-lcurl-lz-lrt-lm-ldl-lnsl-lxml2-lssl-lcrypto-lcurl-lxml2-lssl-lcrypto-lfreetype-lz-lpng12-lxml2-lxml2-lcrypt-lxml2-lxml2, press: lxml2 to save and exit. 2). $make clean & & make & & make install re-performs compilation. 5. Configure environment variable after successful installation: 1 vim / etc/profile
Add the php environment variable at the end of the / etc/profile file:
Source / etc/profile
View the environment variables:
Echo $PATH
After you see the path to the php environment variable, you can use the php command directly later to view the php version:
Php-V6. Today's PHP does not have .ini files and configuration files You also need to configure php-fpm:1 cp php.ini-production / etc/php.ini2 cp / usr/local/php/etc/php-fpm.conf.default / usr/local/php/etc/php-fpm.conf3 cp / usr/local/php/etc/php-fpm.d/www.conf.default / usr/local/php/etc/php-fpm.d/www.conf4 cp sapi/fpm/init.d.php-fpm / etc/init.d/php-fpm5 chmod + x / etc/init.d/php-fpm
Start, stop, and restart of php-fpm:
1 service php-fpm start # start 2 service php-fpm stop # stop 3 service php-fpm restart # restart here, I believe you have a deeper understanding of "CentOS7 how to install PHP7.1", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.