一、 首先交代一个环境问题,编译安装pcre的时候经常会因为没有安装gcc而报c compiler cc is not found
搭建yum源,yum install -y gcc*
建议将lnmp架构所需环境一起搭建,防止编译过程中报错,然后再装各种包
所以,我们直接采用yum安装.配置编译需要的环境
yum -y install autoconf bzip2 bzip2-devel curl curl-devel e2fsprogs e2fsprogs-devel freetype freetype-devel gcc gcc-c++ gcc-g77 gd gd-devel glib2 glib2-devel glibc glibc-devel krb5 krb5-devel libevent libevent-devel libidn libidn-devel libjpeg libjpeg-devel
libpng libpng10 libpng10-devel libpng-devel libtool libtool-libs libxml2 libxml2-devel make ncurses ncurses-devel nss_ldap openldap openldap-clients openldap-devel openldap-servers openssl openssl-devel patch pspell-devel zlib zlib-devel 2
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
二 、nignx的编译安装
在安装nginx之前,为了防止报错,建议
yum -y groupinstall "Development Tools" "Development Libraries"
[root@kissingnginx-1.0.13]#./configure --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --conf-path=/usr
/local/nginx/etc/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nignx/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module
--http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi
--with-pcre
make && make install
[root@kissing nginx]# mv nginx /etc/init.d/
[root@kissing nginx]# chmod +x /etc/init.d/nginx
[root@kissing nginx]# /etc/init.d/nginx start
sed: -e expression #1, char 14: unterminated `s' command
Starting nginx: /usr/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory [FAILED]
[root@kissing nginx]# updatedb
[root@kissingnginx]# locate libpcre.so.1
/usr/local/lib/libpcre.so.1
/usr/local/lib/libpcre.so.1.2.0
[root@kissing nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib
[root@kissing nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64
[root@kissing nginx]# /etc/init.d/nginx start
sed: -e expression #1, char 14: unterminated `s' command
chown: missing operand after `/var/tmp/nginx/fcgi'
Try `chown --help' for more information.
chown: missing operand after `/var/tmp/nginx/uwsgi'
Try `chown --help' for more information.
chown: missing operand after `/var/tmp/nginx/scgi'
Try `chown --help' for more information.
Starting nginx: [ OK ]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
三 、mysql的编译安装
可以参考http://blog.csdn.net/quanliyadan/article/details/11553719
新建用户及相关目录,并修改相关的属主和属组。
useradd mysql
mkdir /var/log/mysql
mkdir /var/lib/mysql
mkdir /datadir
chown mysql.mysql -R /var/log/mysql /var/lib/mysql /datadir
我安装的是mysql的最新版本5.6
tar xf mysql5.6.12.tar.gz -C /usr/src
编译
cd /usr/src/mysql-5.6.12
1.我个人使用的下面参数
cmake -DCMAKE_ISTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=ON -DMYSQL_DATADIR=/datadir -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysql5.sock -DWITH_DEBUG=ON -DEXTRA_CHARSETS=ALL
-DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DSYSCONFDIR=/usr/local/mysql/etc -DWITH_READLINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1
make && make install
2.进行数据库的初始化
./usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/database --user=mysql
当看到两个OK时,表示初始化成功
mkdir /usr/local/mysql/etc
chown -R mysql.mysql /usr/local/mysql
cp /usr/local/mysql/my.cnf /usr/local/mysql/etc/
cd /usr/local/mysql
vi etc/my.cnf
[root@kissing etc]# cat my.cnf | grep -v ^# | grep -v ^$
[mysqld]
log_bin=mysql-bin
log-bin-index = mysql-bin.index
general_log = 1
general_log_file = /var/log/mysql/mysql.log
basedir = /usr/local/mysql
datadir = /database
port = 3306
socket = /var/run/mysqld/mysql.sock
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld5
service mysqld5 start
##########################################################################################
四、php的编译安装
yum groupinstall "X Software Development"
如果想让编译的php支持mcrypt、mhash扩展和libevent,直接编译安装
libevent-2.0.18-stable.tar.gz
libmcrypt-2.5.8.tar.gz
mcrypt-2.6.8.tar.gz
mhash-0.9.9.9.tar.gz
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar xf libiconv-1.14.tar.gz -C /usr/src/lnmp/
cd libiconv-1.14/
./configure --prefix=/usr/local
make && make install
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-MySQL=/usr/local/mysql --with-MySQLi=/usr/local/mysql/bin/mysql_config
--with-iconv-dir=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-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
%%%%%%%%错误总结%%%%%%%%%%%%错误总结%%%%%%%%错误总结%%%%%%%%%%错误总结%%%%%%%%%%%错误总结%%%%%
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
解决方法 yum install libxml* -y
-------------------------------------------------------
checking for T1lib support... no
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
configure: error: jpeglib.h not found.
解决方法 yum install -ylibjpeg libjpeg-devel
-------------------------------------------------------------------------------
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
checking for jpeg_read_header in -ljpeg... yes
configure: error: png.h not found.
解决方法 yum install -ylibpng libpng10 libpng10-devel libpng-devel
----------------------------------------------------------------------------------------------
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype.h not found
解决方法yum install freetype-devel -y
---------------------------------------------------------------------------------
checking for ANSI C header files... (cached) yes
checking for LDAP support... yes
checking for LDAP Cyrus SASL support... yes
configure: error: Cannot find ldap.h
解决方法yum install nss_ldap openldap openldap-clients openldap-devel openldap-servers
checking for LDAP support... yes
checking for LDAP Cyrus SASL support... yes
configure: error: Cannot find ldap libraries in /usr/lib.
解决方法cp -frp /usr/lib64/libldap* /usr/lib 即可
-----------------------------------------------------------------
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/fpm/php-fpm] Error 1
解决方法
cd libmcrypt-2.5.8/libltdl/
./configure --enable-ltdl-install
make && make install
------------------------------------------------------
--------------------------------------------------------------
分享到:
相关推荐
CentOS 6.8编译安装LNMP环境
编译安装lnmp
Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行。由俄罗斯的程序设计师Igor Sysoev所开发,供俄国大型的入口网站及搜索引擎Rambler(俄文:Рамб...
手工尝试安装编译安装LNMP平台文件,全部手打,新手可以一看
CentOS 6.4系统下编译安装LNMP和配置PHP环境.docx
主要介绍了CentOS6.5 编译安装lnmp环境的相关资料及方法,需要的朋友可以参考下
CentOS 6.1(X64)下编译安装LNMP平台(Apache+PHP+MySQL+Testlink)
LNMP架构详细安装教程《博雅运维Linux全套笔记》
主要介绍了关于CentOS 6.8中编译安装LNMP环境的相关资料,LNMP即Linux,Nginx,MySQL,PHP,文中通过一步步的步骤介绍的非常详细,需要的朋友可以参考借鉴,下面来一起看看吧。
支持ssl,curl开启ssl支持,环境为nginx1.8.1+php5.6+mysql5.5,使用时请在根目录创建一个data目录,然后将源码包以及shell脚本复制到该目录,给install*文件可执行权限,然后依次执行对应脚本文件即可。
51CTO学院,实践哥课堂LNMP编译安装课堂笔记,包括nginx编译安装,php编译安装,mysql编译安装,wordpress博客搭建,适合linux入门者学习参考!!
本文给大家分享的是在最新版的centos系统中编译安装lnmp环境的详细步骤,非常的实用,推荐需要的小伙伴们参考下
支持ssl,curl开启ssl支持,环境为nginx1.8.1+php5.6+mysql5.5,使用时请在根目录创建一个data目录,然后将源码包以及shell脚本复制到该目录,给install*文件可执行权限,然后依次执行对应脚本文件即可。
LNMP-LNMP-编译安装
LNMP架构的搭建Discuz论坛的搭建LNMP架构的搭建Discuz论坛的搭建
lnmp 纯手工编译安装 欢迎下载哈 赚点分 分总不够用
1.mysql tar zxf mysql-5.1.55.tar cd mysql-* ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=gbk,gb2312 make && make install ...
测试环境:VM虚拟机系统centos6.8 测试结果:成功源码安装lnmp环境 注意事项:包含全部所需源码包
LNMP架构教程学习手册 内容简介: 1、LNMP简介 2、LNMP搭建
本次实验是在LNMP架构——php+nginx+mysql源码编译搭建lnmp环境基础上进行的,lnmp架构已经搭建好,接下来我将以搭建论坛并且客户使用论坛为例,演示整个过程。 文章目录一、前言二、搭建Discuz论坛实验环境实验 一...