This article describes how to compile and install the lnmp environment in CentOS6.5.
This article describes how to compile and install the lnmp environment in CentOS6.5.
The online search tutorial is as follows:
The Code is as follows:
Yum-y install gcc-c ++ automake autoconf libtool glibc make
Libmcrypt Installation
Mkdir/usr/local/source & cd/usr/local/source # create and enter the source file directory
[Root @ localhost source] # wget "# download libmcrypt
[Root @ localhost source] # Music libmcrypt-2.5.7.tar.gz \? Modtime \ = 1171868460 \ & \; big_mirror \ = 0 libmcrypt-2.5.7.tar.gz # rename
Tar-zxvf libmcrypt-2.5.7.tar.gz # Extract
Cd libmcrypt-2.5.7 # enter the extract directory
./Configure -- prefix =/usr/local/libmcrypt & make install # Installation
An error occurred while compiling and installing libmcrypt. Run rpm-q libmcrypt to check the installed rpm package.
So I refer to another article on lnmp installation.
The Code is as follows:
Yum-y install gcc-c ++ autoconf libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses- devel curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn-devel openssl-devel openldap-devel nss_ldap openldap-clients openldap-servers libXpm * # download and install compilation tools and dependency packages
Yum-y update # update yum
Download the installation package
Mkdir/tmp/source
Cd/tmp/source
Wget # latest
The wget stable version does not support mysql extension because php5.5 does not support the latest version.
Wget # mysql5.6
Wget
Music libmcrypt-2.5.8.tar.gz \? R \ = http \: % 2F % 2Fsourceforge.net % 2 Fprojects % 2 Fmcrypt % 2 Ffiles % 2 FLibmcrypt % 2F2. 5.8% 2F libmcrypt-2.5.8.tar.gz # delete file name for excess Parameters
Wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz
Wget
Music mhash-0.9.9.9.tar.gz \? R \ = http \: % 2F % 2Fsourceforge.net % 2 Fprojects % 2 Fmhash % 2 Ffiles % 2 Fmhash % 2F0. 9.9.9% 2F mhash-0.9.9.9.tar.gz # delete the file name of excess Parameters
Wget
Music mcrypt-2.6.8.tar.gz \? R \ = http \: % 2F % 2Fsourceforge.net % 2 Fprojects % 2 Fmcrypt % 2 Ffiles % 2 FMCrypt % 2F2. 6.8% 2F mcrypt-2.6.8.tar.gz # delete the file name of the excess Parameter
Wget
### Memcache pcre eaccelerator not downloaded yet
Install libiconv, libmcrypt, (# libltdl not installed), mhash, (# Install make does not work with mcrypt), bison
The Code is as follows:
845 tar zxvf libmcrypt-2.5.8.tar.gz
846 cd libmcrypt-2.5.8
847./configure -- prefix =/usr/local/libmcrypt
848 make & make install
836 tar zxvf libiconv-1.14.tar.gz
837 cd libiconv-1.14
838./configure -- prefix =/usr/local
839 make & make install
850 tar zxvf mhash-0.9.9.9.tar.gz
851 cd mhash-0.9.9.9
854./configure -- prefix =/usr/mhash
855 make & make install
Install cmake
The Code is as follows:
Cd/tmp/
Tar zxvf cmake-2.8.3.tar.gz
Cd cmake-2.8.3/
./Configure -- prefix =/usr
Gmake
Gmake install
Prepare users and directories
The Code is as follows:
Groupadd mysql
Useradd-g mysql
Groupadd www
Useradd-g www
Mkdir-p/data/mysql
Chown-R mysql: mysql/data/mysql
Mkdir-p/data/www
Chown-R www: www/data/www
Install mysql
Compile:
The Code is as follows:
Tar zxvf mysql-5.6.22.tar.gz
Cd mysql-5.6.22
Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/data/mysql-DWITH_INNOBASE_STORAGE_ENGINE = 1-runtime = 1-runtime = 1-DSYSCONFDIR =/usr/local/mysql/etc /-DWITH_SSL = yes-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-DWITH_READLINE = on
Make & make install
Ln-s/usr/local/mysql/lib */usr/lib/
Configuration:
The Code is as follows:
/Usr/local/mysql/scripts/mysql_install_db -- basedir =/usr/local/mysql -- datadir =/data/mysql/-- user = mysql
Self-starting
The Code is as follows:
Cp/opt/mysql/support-files/mysql. server/etc/rc. d/init. d/mysqld
Chkconfig -- add mysqld
Chkconfig mysqld on
/Etc/rc. d/init. d/mysqld start
Cd/opt/mysql/
Bin/mysql_secure_installation # Set the mysql account password
Install php
Compile:
The Code is as follows:
Mkdir/usr/local/php
Cd/usr/local/src
Tar zxvf php-5.3.5.tar.gz
Cd php-5.3.5
. /Configure -- prefix =/usr/local/php -- with-config-file-path =/usr/local/php/etc -- with-mysql =/opt/mysql --- mysqli =/usr/local/mysql/bin/mysql_config -- with-iconv-dir =/usr/local -- with-freetype-dir -- with-jpeg-dir -- with-png- dir -- with-zlib -- with-libxml-dir =/usr -- enable-xml -- disable-rpath -- disable-safe-mode -- enable-bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- with-curlwrappers -- enable-mbregex -- enable-fpm -- enable-mbstring (-- with-mcrypt) -- with-gd -- enable-gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable-sockets (-- with-ldap-sasl) -- with-xmlrpc -- enable-zip -- enable-soap
. /Configure -- prefix =/usr/local/php -- enable-fpm -- with-iconv =/usr/local/bin/libiconv \ -- with-mcrypt =/usr/local/bin /libmcrypt \ -- enable-mbstring -- disable-pdo -- with-curl -- disable-debug -- disable-rpath \ -- enable-inline-optimization -- with-bz2 -- with-zlib -- enable-sockets \ -- enable-sysvsem -- enable-sysvshm -- enable-pcntl -- enable-mbregex \ -- with-mhash -- enable-zip -- with-pcre-regex -- with-mysql -- with-mysqli \ -- with-gd -- with-jpeg-dir
Make & make install
Cp php. ini-development/usr/local/php/etc/php. ini # copy the configuration file
Configure php-fpm
The Code is as follows: