centos7下面搭建lnmp环境
参考大神博客:
http://www.linuxzen.com/lnmphuan-jing-da-jian-wan-quan-shou-ce-si-lnmpda-jian-yuan-ma-an-zhuang.html
注意的地方:
1、下载安装包时需要安装wget命令,使用命令
yum -y install wget
2、预编译ngix时可能出现错误
./configure: error: C compiler cc is not found
这是缺少编译环境,安装即可
yum install gcc gcc-c++ ncurses-devel perl
3、安装完ngix时,用netstat查看命令时,报错
netstat: 未找到命令
这时centos下默认未安装,安装即可
yum install net-tools
4、在浏览器中输入虚拟机的ip可能打不开,需要防火墙放开80端口。
firewall-cmd --zone=public --add-port=/tcp --permanent #开启端口
firewall-cmd --reload #重启防火墙
5、安装php依赖包下载不了。需要将下载地址在浏览器中打开就会自动下载。
然后用rz命令传到linux服务器上,按照步骤安装即可。
6、解压.tar.bz2压缩包时报错
tar: bzip2:无法 exec: 没有那个文件或目录
用yum安装bzip2即可。
yum -y install bzip2
7、在安装mcrypt时,报错
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found
解决方法参考连接:http://blog.sina.com.cn/s/blog_8a0f7d200101257u.html
8、文章中给的php版本有点低,网站已经不能下载。可用以下命令下载5.6版本
wget http://ar2.php.net/get/php-5.6.13.tar.gz/from/this/mirror
9、安装依赖包时出错
yum – y install libxml2-devel curl-devel libpng-devel openldap-devel
- y中间多了个空格,去掉即可
10、编译报错 configure: error: Cannot find ldap libraries in /usr/lib
解决办法:http://www.iitshare.com/cannot-find-ldap-libraries-in-usrlib.html
11、安装php时报错:
ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup'
//usr/lib/x86_64-linux-gnu/liblber-2.4.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned exit status
make: *** [sapi/cli/php] Error
解决办法:遇到这种类似的情况,说明「./configure 」沒抓好一些环境变数值。解决方法,来自老外的一篇文章:
在PHP源码目录下 vi Makefile 找到 EXTRA_LIBS 行,在行末添加 ‘ -llber ‘ 保存退出再次make即可。
12、最后还会有一个权限的问题。访问php时会报502错误,在加载/var/run/php-fpm/php-fpm.sock时报没权限。
我就把/var/run/php-fpm/php-fpm.sock权限改为777。估计方法不对,但凑合用下。再想办法看下这个权限怎么搞吧。
最新文章
- [RESTful]HTTP状态码
- 阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署
- 《疯狂Java讲义》(二)---- Java程序的运行机制和JVM
- android 各种xml资源的引用方式
- NEFU 1146 又见A+B
- jquery+ajax(用ajax.dll)实现无刷新分页
- 开始写自己的iOS技术博客了
- ASP.NET网站前端页面的复制
- HDU-2149 Public Sale
- ubuntu下的openfire安装、配置、运行
- HDOJ(HDU) 2138 How many prime numbers(素数-快速筛选没用上、)
- Prim算法(普里姆算法)
- 在VHDL中,“传输延迟”和“惯性延迟”
- 基于hadoop的图书推荐
- Scrapy-简单介绍
- PMP知识点(五)——资源管理表示方法
- SpringMVC+Apache Shiro+JPA(hibernate)案例教学(四)基于Shiro验证用户权限,且给用户授权
- 数学和物理太难?这些 GIF 让你秒懂抽象概念
- Openvswitch手册(2): OpenFlow Controller
- MySQL入门介绍(mysql-8.0.13)
热门文章
- Hessian原理与程序设计
- Shell脚本之:case
- template.js文档
- typedef struct与struct定义结构体
- 启动Eclipse时,启不起来JVM terminated. Exit code=-1
- HDFS源码分析心跳汇报之数据块汇报
- 【BZOJ3834】[Poi2014]Solar Panels 分块好题
- jQuery学习笔记(9)--jquery中的事件--$(document).ready()
- intellij idea使用技巧
- 如果数据需要被多个应用程序消费的话,推荐使用 Kafka,如果数据只是面向 Hadoop 的,可以使用 Flume