Centos7 PHP offline installation

1. Download

https://www.php.net/downloads

2. Unzip and configure

tar -zxvf php-7.4.13.tar.gz
cd php-7.4.13/
./configure

3. Compile

make

4. Install dependent packages

The compilation process may cause compilation errors due to the lack of dependent packages. You need to install the missing dependent packages and then recompile

yum install libxml2-devel
yum install sqlite-devel
make

5. Installation

Install after successful compilation

make install

6. Copy php.ini

View php.ini path

php -i | grep php.ini

Copy php.ini-development in the source decompression directory to /usr/local/lib as shown in the figure above and change the name to php.ini

cd php-7.4.13/
cp php.ini-production  /usr/local/lib/php.ini

7. Installation test

php -i | grep php.ini

8. Version testing

php -v

 

Guess you like

Origin blog.csdn.net/abcdu1/article/details/112317578