大佬教程收集整理的这篇文章主要介绍了centOS6.6 编译安装lnmp(PHP 7.0.9+Nginx1.9.9+MySQL5.7.15),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
一、系统约定
源代码位置:/usr/local/src
安装位置:/usr/local/软件名字
二、软件下载
(所需软件几乎可以全部从搜狐镜像站http://mirrors.sohu.com/下载,速度快)
1、下载Nginx(目前稳定版)
[root@bogon src]# wget http://nginx.org/download/nginx-1.9.9.tar.gz
2、下载pcre (支持Nginx伪静态)
[xuj@bogon ~]$ wget ftp://ftp.csx.cam.ac.uk/pub/software/progrAMMing/pcre/pcre-8.39.tar.gz
3、下载MysqL
[root@bogon src]# wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.15.tar.gz
http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.14.tar.gz
4、下载php
[root@bogon src]# wget http://mirrors.sohu.com/php/php-7.0.9.tar.gz
5、下载cmake(MysqL编译工具)
[root@bogon src]# wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
6、下载libmcrypt(phplibmcrypt模块)
http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
7、下载GD库安装包
[root@bogon src]# wget https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.1.tar.gz
或http://download.csdn.net/download/xujunabc999/9629853 下载完用winscp软件上传
三、安装过程
./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --enable-MysqLnd --with-MysqLi=@H_522_109@mysqLnd --with-pdo-MysqL=@H_522_109@mysqLnd --with-MysqLi=/usr/local/MysqL/bin/MysqL_config --with-MysqL-sock=/tmp/MysqL.sock --with-gd=/usr/local/gd --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-freetype-dir=/usr/lib --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbString --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype
可以通过./configure -Help查看支持的扩展,目前php7的configure的参数没有–with-MysqL参数,只支持–with-MysqLi和–with-pdo-MysqL
安装缺少的组件(若没有提示缺少组件,请忽略),如:
yum install libxml2
yum install libxml2* -y
yum install openssl-dev
yum install libcurl3-openssl-dev
yum install openssl-devel.i686
yum install openssl-perl.i686
yum install libcurl-devel.i686
yum install libjpeg-turbo-devel.i686
yum install libpng.i686
yum install libpng-devel.i686
yum install freetype-devel
yum install php-gd
@H_96_1@make #编译 disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,sHell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapesHellcmd,dll,popen,disk_free_space,checkdnsrr,getservbyname,getservbyport,disk_@R_4_10586@l_space,posix_ctermid,posix_get_last_error,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname
8.配置Nginx支持php
vi /usr/local/Nginx/conf/Nginx.conf
修改/usr/local/Nginx/conf/Nginx.conf 配置文件,需做如下修改
user www www; #首行user去掉注释,修改Nginx运行组为www www;必须与/usr/local/php7/etc/php-fpm.conf中的user,group配置相同,否则php运行出错
index index.php index.html index.htm; #添加index.php
pass the php scripts to FastCGI server listening on 127.0.0.1:9000
#
LOCATIOn ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILename $document_root$fastcgi_script_name;
include fastcgi_params;
}
/etc/init.d/Nginx restart #重启Nginx
[root@bogon MysqL-5.7.15]#cmake -DCMAKE_INSTall_PREFIX=/usr/local/MysqL -DMysqL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMysqL_TCP_PORT=3306 -DMysqL_USER=MysqL -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 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost
9.2 出错:curses library not found. Please install appropriate package
– Could NOT find curses (missing: cursES_LIBRARY cursES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (messaGE):
curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.on Debian/Ubuntu,package name is libncurses5-dev,on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:118 (FIND_cursES)
cmake/readline.cmake:214 (MysqL_USE_BUNDLED_READLINE)
CMakeLists.txt:257 (MysqL_checK_READLINE)
– Configuring incomplete,errors occurred!
解决办法:
[root@bogon MysqL-5.7.15]# rm -f CMakeCache.txt
yum -y install ncurses-devel
然后再使用cmake编译就可以了.
9.3 ERROR:. No pool defined at least one pool section must be specified in config file
ERROR: Failed to post process the configuration
ERROR: FPM initialization Failed
solution:
在/usr/local/php7/etc/php-fpm.d目录下
cp www.conf.default www.conf
参考:
http://www.osyunwei.com/archives/5235.html
http://blog.csdn.net/u014595668/article/details/50188127
以上是大佬教程为你收集整理的centOS6.6 编译安装lnmp(PHP 7.0.9+Nginx1.9.9+MySQL5.7.15)全部内容,希望文章能够帮你解决centOS6.6 编译安装lnmp(PHP 7.0.9+Nginx1.9.9+MySQL5.7.15)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。