PHP for Linux source code compilation installation and configuration

Source: Internet
Author: User

PHP (foreign name: Php:hypertext Preprocessor, Chinese name: "Hypertext Preprocessor") is a common open source scripting language. The grammar absorbs the C language, Java and Perl features, is conducive to learning, widely used, mainly for the field of web development. PHP's unique syntax mixes the syntax of C, Java, Perl, and PHP's own creation. It can execute Dynamic Web pages more quickly than CGI or Perl. Dynamic pages made in PHP are compared to other programming languages, and PHP is executed in HTML (an application under the standard Universal Markup Language), which is much more efficient than CGI, which generates HTML markup entirely; PHP can also execute post-compilation code, Compilation can achieve encryption and optimize code execution, making code run faster.

First, download

: http://cn2.php.net/distributions/php-5.6.8.tar.gz

Second, installation

Tar xzvf php-5.6.8.tar.gz

CD php-5.6.8

php Compiler parameters:

#!/bin/sh
./configure \
--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE2/BIN/APXS \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql=/usr/local/mysql \
--with-zlib \
--WITH-GD \
--with-freetype-dir \
--with-png-dir \
--with-jpeg-dir \
--with-mcrypt \
--enable-mbstring \

--ENABLE-FPM \
--disable-debug

Make && make install

Third, the configuration

CP Php.ini-development/usr/local/php/lib/php.ini

cd/usr/local/php/etc/

CP Php-fpm.conf.default php-fpm.conf

Sed-i "S/nobody/apache/g" php-fpm.conf

Ln-s/usr/local/php/sbin/php-fpm/usr/sbin/

Note: In conjunction with nginx use, if it is Apache can not be configured;

Four, check

Add a info.php file to the Apache Web program directory with the following content:

<?php

Phpinfo ();

?>

Open the browser, in the address bar input: http://ip/info.php, if the normal display of PHP corresponding information can be;

Compile PHP Error Resolution:

Configure:error:xml2-config not found. Please check your LIBXML2 installation.

Yum-y Install LIBXML2 Libxml2-devel
------------------------------------

Configure:error:jpeglib.h not found.

Yum-y Install Libjpeg Libjpeg-devel
------------------------------------

Configure:error:png.h not found.

Yum-y Install libpng Libpng-devel
------------------------------------

Configure:error:freetype-config not found.

Yum-y Install FreeType Freetype-devel
------------------------------------

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.

Yum-y Install Libmcrypt-devel

This article is from the "Square Hill" blog, please be sure to keep this source http://63638790.blog.51cto.com/513514/1649837

PHP for Linux source code compilation installation and configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.