Home > Backend Development > PHP7 > body text

Linux source code installation php7.2.0

马冠亚
Release: 2023-02-17 16:58:01
Original
3236 people have browsed it

1. Source code package download address

https://pan.baidu.com/s/1bpi4D9l
Copy after login

2. Unzip the php compressed package:

tar –zxvf php-7.2.0.tar.gz
Copy after login

3. Enter the decompressed file:

cd php7.2.0
Copy after login

4. Install the extensions required for PHP

yum install libxml2 libxml2-devel openssl openssl-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel -y
Copy after login

5. Start configuration---detailed explanation of configuration parameters

./configure --prefix=/usr/local/php720 --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-simplexml --enable-xml --disable-rpath --enable-bcmath --enable-soap --enable-zip --with-curl --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --enable-sockets --with-gd --with-openssl --with-mhash --enable-opcache --disable-fileinfo
Copy after login

6. Compile and install

make && make install
Copy after login

7. Configure nginx.conf to support parsing PHP

Open the nginx configuration file (/usr/local/nginx /conf/nginx.conf)

Find the localtion module and add index.php after index to make nginx recognize the php file;

Linux source code installation php7.2.0

Continue to scroll down, Modify again:

Linux source code installation php7.2.0 Start php-fpm:

1. Copy php-fpm.conf.default to php-fpm .conf

cd /usr/local/php720/etc
cp php-fpm.conf.default php-fpm.conf
Copy after login

2. Then start php-fpm

/usr/local/php720/sbin/php-fpm
Copy after login

If an error is reported at startup (as shown below):

Linux source code installation php7.2.0

Solution: Enter Go to www.conf.default under /usr/local/php720/etc/php-fmp.d and copy it to www.conf, then start php-fpm;

Enter the folder (if you can’t enter, just CD in step by step; if there is no such file, create a php-fpm.d folder yourself, and then go to the website to download the www.conf file: https://pan.baidu.com/s/ 1o8mRYkU)

cd /usr/local/php720/etc/php-fpm.d
cp www.conf.default www.conf
Copy after login

First clear the php-fpm process

pkill php-fpm

Restart php-fpm

##/usr/local/php720/sbin/php-fpm

Finally in / Create a new file index.php under usr/local/nginx/html and output phpinfo;

displays successful, indicating that PHP is installed successfully

The above is the detailed content of Linux source code installation php7.2.0. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template