This article mainly introduces the source code installation PHP7, has a certain reference value, now share to everyone, the need for friends can refer to
Source Installation PHP7
First, download PHP source package
Second, compile and install
-
Extract
-
Configure
-
Make
-
Make install
-
Execution yourpath/bin/php -m , if you can see the extension of PHP, indicating that the installation was successful
Iii. Simplifying PHP execution commands
Iv. Some of the pits that may be encountered
-
Installing PHP requires you to install GCC and AutoConfig
-
Copy the php.ini-development of the source directory to Yourpath/etc
-
and renamed Php.ini-development to PHP.ini.
-
php -i | grep php.ini, you can see that php.ini is placed by default in the Yourpath/lib directory
-
So put the php.ini under the Yourpath/lib.
Five, through the phpize for PHP to do not recompile PHP installation of OpenSSL
-
PHP Source code path:/opt/download/php-7.2.5
-
Installation path:/opt/soft/php
-
PHP.ini Path:/opt/soft/php/lib
-
Enter the extended directory for OpenSSL
-
Run Phpize
-
If cannot find CONFIG.M4 error occurs, the
-
Performing the installation
-
After the installation is complete, you will be prompted to generate the. So file in a directory where my build location is
-
Open PHP.ini, add the following two lines
-
Restart PHP to
Vi. Installation of composer
-
Download the Composer.phar to the project
-
If the Composer.phar is placed in the PATH directory of the system, it can be accessed globally Composer.phar
Related recommendations:
Redis Source Code parsing