Download first on the PHP website
[Email protected] src]# wget http://cn2.php.net/distributions/php-7.0.8.tar.gz
Extract
[Email protected] src]# tar zxvf php-7.0.8.tar.gz
The downloaded file format is different, the decompression method is not the same
The PHP version is different, but the installation process is the same. Continue to use the document.
[Email protected] php-7.0.8]#/configure \
>--prefix=/usr/local/php \
>--WITH-APXS2=/USR/LOCAL/APACHE2/BIN/APXS \
>--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP/ETC \
>--with-mysql=/usr/local/mysql \
>--with-libxml-dir \
>--WITH-GD \
>--with-jpeg-dir \
>--with-png-dir \
>--with-freetype-dir \
>--with-iconv-dir \
>--with-zlib-dir \
>--with-bz2 \
>--with-openssl \
>--with-mcrypt \
>--enable-soap \
>--enable-gd-native-ttf \
>--enable-mbstring \
>--enable-sockets \
>--enable-exif \
>--disable-ipv6
(The landlord will be the system Yum source for 163 on the Yum source, specific operation, ask Niang)
Some errors occur during this process because PHP relies on some packages.
In this step, the landlord encountered the following error:
Configure:error:xml2-config not found. Please check your LIBXML2 installation.
The solution is:
Yum Install-y libxml2-devel
There are also errors:
Configure:error:Cannot find OpenSSL ' s <evp.h>
The solution is:
Yum Install-y OpenSSL Openssl-devel
Error:
Checking for BZIP2 in default path ... not foundconfigure:error:Please reinstall the BZIP2 distribution
Workaround:
Yum install-y bzip2 Bzip2-devel
Error:
Configure:error:png.h not found.
Workaround:
Yum install-y libpng Libpng-devel
Error:
Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
Workaround:
Yum Install-y libmcrypt-devel
[[email protected] php-7.0.8]# echo $?
0
[[email protected] php-7.0.8]# make this process for about 5 minutes
Build complete.
Don ' t forget to run ' make test '. This step is complete when this is indicated
[[email protected] php-7.0.8]# make install
echo $? Until the installation is complete.
--with-apxs2=/usr/local/apache2/bin/apxs APXS is an automated tool to help users install extension modules.
--with-mysql=/usr/local/mysql Here you can see that PHP is also dependent on MySQL, so this is why to install MySQL first, and finally install PHP.
###########################################################################################
[Email protected] php-7.0.8]# ls/usr/local/apache2/modules/
Httpd.exp libphp7.so mod_deflate.so mod_expires.so mod_rewrite.so
This directory is more than a libphp7.so, and how this libphp7.so produced, is because Apxs,apxs helped to give birth to this file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PHP Tips
[[email protected] php-7.0.8]#/usr/local/php/bin/php-m See the module below PHP
Look at the static.
[[email protected] php-7.0.8]#/usr/local/php/bin/php-i view PHP-related configuration
This article is from the "Cbo#boy_linux Road" blog, make sure to keep this source http://20151213start.blog.51cto.com/9472657/1854696
LAMP's three PHP compiler installation