Table of Contents
CentOS6.5 compile and install lnmp environment, centos6.5lnmp
Home Backend Development PHP Tutorial CentOS6.5 compile and install lnmp environment, centos6.5lnmp_PHP tutorial

CentOS6.5 compile and install lnmp environment, centos6.5lnmp_PHP tutorial

Jul 13, 2016 am 10:11 AM
lnmp Compile and install

CentOS6.5 compile and install lnmp environment, centos6.5lnmp

The tutorials found online are as follows

Copy code The code is as follows:

yum -y install gcc 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 "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0 #Download libmcrypt
[root@localhost source ]# mv 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 #Unzip
cd libmcrypt-2.5.7 #Enter the decompression directory
./configure --prefix=/usr/local/libmcrypt && make && make install #Install

Because there has been an error when compiling and installing libmcrypt, run rpm –q libmcrypt to view the installed rpm package and found that it failed

So I referred to another article about installing lnmp

Copy code The code is as follows:

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap 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 http://nginx.org/download/nginx-1.7.8.tar.gz #Latest
wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4 stable version Because php5.5 does not support mysql extension, the latest one is not used for the time being
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6
wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt %2F2.5.8%2F&ts=1418528625&use_mirror=tcpdiag
mv libmcrypt-2.5.8.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F libmcrypt-2.5.8.tar.gz #Delete files with redundant parameters First name
wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz
wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash %2F0.9.9.9%2F&ts=1418530194&use_mirror=hivelocity
mv mhash-0.9.9.9.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash%2F0.9.9.9%2F mhash-0.9.9.9.tar.gz #Delete redundant parameters file name
wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt %2F2.6.8%2F&ts=1418531968&use_mirror=softlayer-dal
mv mcrypt-2.6.8.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt%2F2.6.8%2F mcrypt-2.6.8.tar.gz #Delete files with redundant parameters First name
wget http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
###No download yet memcache pcre eaccelerator

Install libiconv, libmcrypt, (#libltdl is not installed), mhash, (#Installing make has no effect mcrypt), bison

Copy code 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

Copy code 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

Copy code The code is as follows:

groupadd mysql
useradd -g mysql mysql
groupadd www
useradd -g www www
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql
mkdir -p /data/www
chown -R www:www /data/www

Install mysql

Compile:

Copy code 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 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=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/lib* /usr/lib/

Configuration:

Copy code The code is as follows:

/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

Self-start

Copy code 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 mysql account password

Install php

Compile:

Copy code 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 --with-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 --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 configuration file

Configure php-fpm

Copy code The code is as follows:

cd /usr/local/php
cp etc/php-fpm.conf.default etc/php-fpm.conf
vi etc/php-fpm.conf
pid = run/php-fpm.pid
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 5s

148 149 lines

Copy code The code is as follows:

user = www
group = www

3) Copy the php configuration file to the php default configuration file path

4) Change configuration file (set time zone)

Copy code The code is as follows:

vim /usr/local/php/lib/php.ini

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

date.timezone = PRC

Install nginx
Install PCRE

Copy code The code is as follows:

wget http://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36 %2F&ts=1418696677&use_mirror=iwebhttp://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre %2F8.36%2F&ts=1418696677&use_mirror=iweb
mv pcre-8.36.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gz
tar zxvf pcre-8.36.tar.gz
cd pcre-8.36 && ./configure && make && make install

Install zlib

Copy code The code is as follows:

wget http://zlib.net/zlib-1.2.8.tar.gz
tar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

Install ssl

Copy code The code is as follows:

wget http://www.openssl.org/source/openssl-1.0.1j.tar.gz
tar zxvf openssl-1.0.1j.tar.gz

Install nginx

Copy code The code is as follows:

mkdir /usr/local/nginx
tar zxvf nginx-1.7.8.tar.gz
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module - -with-pcre=/usr/local/src/pcre-8.36 --with-zlib=/usr/local/src/zlib-1.2.8 --with-openssl=/usr/local/src/openssl-1.0. 1j && make && make install

Configure nginx

Copy code The code is as follows:

vim /usr/local/nginx/conf/nginx.conf

Start the server

Copy code The code is as follows:

/opt/nginx/sbin/nginx
/opt/php/sbin/php-fpm.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/930485.htmlTechArticleCentOS6.5 Compile and install lnmp environment, centos6.5lnmp The tutorials found on the Internet are as follows. Copy the code as follows: yum - y install gcc gcc-c++ automake autoconf libtool glibc make libmcrypt installation...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Announcement of 2025 PHP Situation Survey Announcement of 2025 PHP Situation Survey Mar 03, 2025 pm 04:20 PM

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio

See all articles