LNMP PHP Compilation installation

Source: Internet
Author: User
Tags php language mcrypt php download

LNMP installation, Linux nginx MySQL PHP, these four software installed up.

llinux+ Nginx + MySQL + phplphp is a scripting language, the current Chinese and even the world using PHP language development site is very common Lnginx is a Web services software, and Apache is a kind of software, At present, the enterprise using Nginx more and more lmysql is the most popular small relational database Llnmp is an environment that supports parsing PHP programs.


The first installation of the MySQL process and lamp is the same, see the previous lamp notes. Install PHP again.


Mysql installation See the following two OK to indicate successful installation. can also Eche $?

When specifying MySQL privileges!

Installing MySQL system tables ...

Ok

Filling Help Tables ...

Ok

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

PHP Download Version 5.6

[email protected] src]# wget http://cn2.php.net/distributions/php-5.6.27.tar.bz2 #下载


[Email protected] src]# tar jxvf php-5.6.27.tar.bz2 #解压


[Email protected] src]# cd/php-5.6.27/

Compiling the installation

L./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--enable-fpm--with-fpm-user= PHP-FPM--with-fpm-group=php-fpm--with-mysql=/usr/local/mysql--with-mysql-sock=/tmp/mysql.sock--with-libxml-dir --WITH-GD--with-jpeg-dir--with-png-dir--with-freetype-dir--with-iconv-dir--with-zlib-dir--with-mcrypt--en Able-soap--enable-gd-native-ttf--enable-ftp--enable-mbstring--enable-exif--enable-zend-multibyte--DISABLE-IPV 6--with-pear--with-curl

[[email protected] src]# make # This step landlord or error, the last installation lamp is the same

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


Yum install-y libxml2-devel #安装libxml2-devel

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

Configure:error:Please Reinstall the Libcurl distribution-


[Email protected] php-5.6.27]# yum-y install Curl-devel #安装


Or do you have to report the following mistake?

Configure:error:jpeglib.h not found.


[[email protected] php-5.6.27] #yum-y install libjpeg-devel #安装


Configure:error:png.h not found.

Yum-y Install Libpng-devel


Configure:error:freetype-config not found.

Yum-y Install Freetype-devel


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

################################################################

Episode SZ Tool Installation

Rz,sz is a command-line tool that Linux/unix Zmodem file transfers with Windows.

The advantage is that you don't have to open an SFTP tool to log in to upload the downloaded file.


SZ: Send the selected file (send) to the local machine

RZ: Run the command will Bounce (www.111cn.net) out a File Selection window, from the local selection of files uploaded to the Linux server


installation command:


Yum Install Lrzsz


To send files from the server to the client:


SZ filename


Uploading files from the client to the server:


From:http://www.111cn.net/sys/linux/67810.htm

####################################################################

[[email protected] php-5.6.27] #yum-y install Freetype-devel #安装 (no successful installation here)

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

Scenario Two:

[Email protected] src]# tar zxvf libmcrypt-2.5.7.tar.gz #解压


[Email protected] src]# CD libmcrypt-2.5.7/ #进入安装目录


[Email protected] src]#/configure #配置


[email protected] libmcrypt-2.5.7]# make #编译

[[email protected] libmcrypt-2.5.7]# make install #安装


[[email protected] libmcrypt-2.5.7]# echo $? #检测有没有问题

0

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


Finally the second solution was solved. Then proceed to the next step of PHP


[[email protected] php-5.6.27]# Make # This process takes about 5 minutes


[[email protected] php-5.6.27]# echo $?

0

[[email protected] php-5.6.27]# make install


[[email protected] php-5.6.27]# echo $?

0


[Email protected] php-5.6.27]# ls/usr/local/php/

Bin etc include Lib Php sbin var


Copy the PHP configuration file

[email protected] php-5.6.27]# CP Php.ini-production/usr/local/php/etc/php.ini

Copy Startup scripts

[email protected] php-5.6.27]# CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM

[Email protected] php-5.6.27]# chmod 755/etc/init.d/php-fpm #授予执行权限


[Email protected] php-5.6.27]# chkconfig--add php-fpm #加入到系统服务列表


[[email protected] php-5.6.27]# chkconfig php-fpm on # boot up


[[Email protected] php-5.6.27]# service PHP-FPM start #吂动服务 (because the profile does not exist, it does not start up)

Starting PHP-FPM [03-nov-2016 01:35:33] error:failed to open configuration file '/usr/local/php/etc/php-fpm.conf ': No suc h file or directory (2)

[03-nov-2016 01:35:33] error:failed to load configuration file '/usr/local/php/etc/php-fpm.conf '

[03-nov-2016 01:35:33] ERROR:FPM initialization failed

Failed

[Email protected] php-5.6.27]# cd/usr/local/php/etc/#进入到配置文件目录
[email protected] etc]# ls #查看配置文件
Php-fpm.conf.default php.ini #红色的就是配置文件

[Email protected] etc]# mv Php-fpm.conf.default php-fpm.conf #拷贝配置文件

[[email protected] etc]#/usr/local/php/sbin/php-fpm-t # Check configuration file for errors
[03-nov-2016 01:40:02] Notice:configuration file/usr/local/php/etc/php-fpm.conf Test is successful


[[Email protected] etc]# service php-fpm start # Start again or error (because no user was created)

Starting PHP-FPM [03-nov-2016 01:42:52] ERROR: [Pool www] cannot get uid for user ' php-fpm '

[03-nov-2016 01:42:52] ERROR:FPM initialization failed

Failed


[[email protected] etc]# useradd-s/sbin/nologin php-fpm #创建用户, but no user login required

#php-FPM This user has been defined at compile time.

[[Email protected] etc]# service php-fpm start #再次启动 OK

Starting php-fpm Done


[[Email protected] etc]# PS aux |grep php-fpm # View the process started

Root 34321 0.0 0.4 109096 4264? Ss 01:44 0:00 php-fpm:master process (/usr/local/php/etc/php-fpm.conf)

php-fpm  34322  0.0  0.3 109096  3912?         S    01:44   0:00 php-fpm:pool www                     & nbsp                          ,         &NB Sp                          ,         &NB Sp              

PHP-FPM 34323 0.0 0.3 109096 3912? S 01:44 0:00 Php-fpm:pool www

Root 34325 0.0 0.0 103252 824 pts/0 s+ 01:46 0:00 grep php-fpm


[Email protected] etc]# NETSTAT-LNP #查看监听的端口

Active Internet connections (only servers)

Proto recv-q send-q Local address Foreign address State Pid/program Name

TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1080/sshd

TCP 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1306/master

TCP 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 34321/php-fpm

TCP 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1217/mysqld

TCP 0 0::: $:::* LISTEN 1080/sshd

TCP 0 0:: 1:25:::* LISTEN 1306/master

UDP 0 0 0.0.0.0:68 0.0.0.0:* 1563/dhclient

This concludes the installation of PHP.

This article is from the "Cbo#boy_linux Road" blog, make sure to keep this source http://20151213start.blog.51cto.com/9472657/1868623

LNMP PHP Compilation installation

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.