原文:

LAMP环境搭建:Linux下Apache,MySQL,PHP安装与配置

http://hi.baidu.com/xf0825/blog/item/7b58cb621e0e41d6e7113a85.html

注意安装lamp环境为了的使用cacti请在安装php的时候一定要添加上--enable-sockets。

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/lib --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql --with-zlib --enable-mbstring --enable-xml --enable-sockets

否则会出现:

The following PHP extensions are missing:

* sockets
Please install those PHP extensions and retry

安装php需要head,需要安装MySQL-devel-提示报错,解决办法。

安装MySQL-devel-community-5.1.39-0.rhel5.i386.rpm

不安装的话,编译php 会提示找不到mysql 文件头的 ,如果出现
Preparing... ########################################### [100%]
file /usr/bin/mysql_config from install of MySQL-devel-community-5.1.39-0.rhel5.i386 conflicts with file from package mysql-5.0.77-4.el5_4.1.i386
file /usr/share/man/man1/mysql_config.1.gz from install of MySQL-devel-community-5.1.39-0.rhel5.i386 conflicts with file from package mysql-5.0.77-4.el5_4.1.i386
-------------------------------------------
说明跟5.077那个包冲突,要现删掉,或者安装加上 --froce参数,强制安装。
rpm -ivh MySQL-devel-community-5.1.39-0.rhel5.i386.rpm --force