Linux source code compile and install php7.2

Following a brief introduction on how to install the source code PHP, not necessarily for version 7.2, 7.3 may also be, of course, is the new name of the method, the core of the same thing.

 

First, download the PHP source code

You need to specify the path to download the source code, execute the following command

wget http://cn2.php.net/distributions/php-7.2.21.tar.gz

 

Second, extract the source

Directly in the current directory to archive decompression

tar -xzvf php-7.3.3.tar.gz

tar command Description:

必要参数有如下:

-A 新增压缩文件到已存在的压缩
-c 建立新的压缩文件
-d 记录文件的差别
-r 添加文件到已经压缩的文件
-u 添加改变了和现有的文件到已经存在的压缩文件
-x 从压缩的文件中提取文件
-t 显示压缩文件的内容
-z 支持 gzip 解压文件
-j 支持 bzip2 解压文件
-Z 支持compress解压文件
- v  显示操作过程
-l 文件系统边界设置
-k 保留原有文件不覆盖
-m 保留文件不被覆盖
-W 确认压缩文件的正确性
 
The third step: in the php file after the files are decompressed
cd php-7.2.21

  

Step four: Install compile PHP to the specified directory

./configure --prefix=/data/soft/php

If the compiler error occurs, the error can be resolved to get the Baidu search.

 

Step Five: Run make, make compile the makefile

make

  

make Command Description:

Using the GNU Linux environment make the tools easier to construct a part of your own project, compiling the whole project only needs to complete a command to compile and link so that the final execution. But this requires us to invest some time to complete the preparation of one or more files called Makefile. This document is the foundation make work properly.

make is a command tool, which explains the Makefile command (it should be said that the rules). In the Makefile describes the sequence of the entire project to compile all the files, compiled rules.

 

After a successful installation will be displayed "Thank you for using PHP."

 

The installation process wrong solution:

make: *** did not specify a target and can not find the makefile. stop.

Perform the following method :( because there is no installation GCC)

yum install gcc-c++ -y 

 

You can see whether there is also need to install openssl, if you need to perform the installation openssl

yum install openssl* -y

  

Step 6: After installing you can use "make test" to test whether the installed (this command after performing relatively long time) this step can too

make test

  

Step Seven: The final step run make install command to install complete

make install

  

 

More PHP, LINUX can focus public number: Okinawa memory programming library acquisition

Recommended books:

 

 

 

 

Guess you like

Origin www.cnblogs.com/leoyi330/p/11370516.html