Method:
1) wgethttp://mirrors.sohu.com/php/php-5.6.9.tar.gz
2) Enter the decompressed PHP source code directory, execute ./configure --enable-fpm --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-mcrypt --with-pdo_mysql --with-openssl --disable-fileinfo
3) Execute make && make install
Instructions:
1) --enable-fpm is to start php through php-fpm, so that it can be compared The php-cgi method better manages FastCGI. (The latter is easy to hang up automatically. Pay special attention to the above configurations that must be written once. If you just add --enable-fpm to compile a version just to use php-fpm, it may cause inconsistency in the compiled version. Many questions)
2) --with-apxs2=/usr/local/apache2/bin/apxs This is related to apache and must be configured so that the libphp5.so generated by compilation will be automatically added to apache Go to the side.
3) --with-mcrypt --with-pdo_mysql --with-openssl These are necessary for laravel
4) --disable-fileinfo must be added, otherwise the compilation may report an error: virtual memory exhausted : Cannot allocate memory
Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces the PHP source code compilation that supports laravel and apache under Linux, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.