Linux Compilation install PHP Mysql Nginx

Source: Internet
Author: User
Tags echo date fpm install php openssl php mysql

Installing a compiler such as gcc g++

Yum-y install gcc gcc-c++ automake autoconf libtool glibc make

Install some LNMP -dependent libraries

Yum Install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel FreeType Freetype-devel libxml2 libxml2-devel zlib zlibbzip2bzip2-devel ncurses ncurses- Devel Curl Curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL openssl-devel

It seems that yum can't install libmcrypt after CentOS 6.0 .
Do not solve this problem, compile php,~ ~ ~ Install libmcrypt

TAR-ZXVF libmcrypt-2.5.7.tar.gz

./configure--prefix=/usr/local/libmcrypt

Make && make install

-----------------------------------------------------------------------------------

MAKE[2]: Leaving directory '/USR/LOCAL/SRC/LIBMCRYPT-2.5.7/SRC '

Making All in doc

MAKE[2]: Entering directory '/usr/local/src/libmcrypt-2.5.7/doc '

MAKE[2]: Nothing to is done for ' all '.

MAKE[2]: Leaving directory '/usr/local/src/libmcrypt-2.5.7/doc '

MAKE[2]: Entering directory '/usr/local/src/libmcrypt-2.5.7 '

MAKE[2]: Leaving directory '/usr/local/src/libmcrypt-2.5.7 '

MAKE[1]: Leaving directory '/usr/local/src/libmcrypt-2.5.7 '

-----------------------------------------------------------------------------

It is OK to report this mistake, as long as it is not error , this hint means to leave the current directory.

installation PHP

: http://php.net/downloads.php

TAR-ZXVF php-5.4.  + . TAR.GZCD php-5.4.  +

./configure--prefix=/usr/local/php  --enable---with-mcrypt=/usr/local/--enable-mbstring-- Disable-pdo--with-curl--disable-debug  --disable---enable-inline-optimization--with-bz2  -- With-zlib--enable---enable-sysvsem--enable-sysvshm--enable-pcntl--enable---with-mhash-- enable-zip --with-pcre-regex--with-mysql--with---with-gd--with-jpeg-dir

If there is an error reference http://www.cnblogs.com/wangxusummer/p/4094340.html

Make && make install

Add www user Group, add www user, and add www to www user group

-G www www

Copy the php-fpm configuration file

Cp/usr/local/php/etc/php-fpm.conf. default /usr/local/php/etc/php-fpm.conf

Change the configuration file

The preceding semicolon removes The process number generated by the pid for php-fpm

148 149 User group is changed to www .

PID = run/php-== www

Copy Php config file to php default configuration file path

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

Ln-s/usr/local/php/bin/php/usr/bin/php

Test

" echo Date (' y-m-d h:i:s '); "

If a time zone error occurs

Change the configuration file

Vim/usr/local/php/etc/php.ini

919 Line, time zone changed to PRC, is the People's Republic of China.

Date.timezone = PRC

installation Nginx

Linux Compilation install PHP Mysql Nginx

Related Article

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.