此编译参数是老师给我的,这是他原来在公司工作时使用的参数。使用这个参数一般都没有问题。

Apache 编译参数

./configure \

--prefix=/lamp/apache \

--enable-deflate \

--enable-expires \

--enable-headers \

--enable-modules=most \

--enable-so \

--with-mpm=worker \

--enable-rewrite

常见编译出错问题 如下:

解决httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0

整合apachephp之后,apche重启提示:

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

解决办法非常简单:

#vim /web/apache/conf/httpd.conf (在这里/web/apahce是我安装apache的目录,你默认安装的话应该是/usr/local/apache2/icons)

 找到#ServerName www.example.com:80   #去掉,再重启apache即可没事了。

 

Mysql数据库编译参数

./configure --prefix=/lamp/mysql \

--with-unix-socket-path=/lamp/mysql/mysql.sock \

--localstatedir=/lamp/mysql/data \

--enable-assembler --enable-thread-safe-client \

--with-mysqld-user=mysql \

--with-big-tables \

--without-debug \

--with-pthread \

--enable-assembler \

--with-extra-charsets=complex \

--with-readline \

--with-ssl \

--with-embedded-server \

--enable-local-infile \

--with-plugins=partition,innobase \

--with-plugin-PLUGIN  \

--with-mysqld-ldflags=-all-static  \

--with-client-ldflags=-all-static

 

常见问题:编译安装完成之后,没有 data 目录

 

[root@purple mysql]# bin/mysql_install_db            ##初始化数据库

[root@purple mysql]# useradd -s /sbin/nologin  mysql   ##新建用户 mysql  并指定shell类型为nologin

[root@purple mysql]# chown mysql:mysql data –R           ##修改data 所属组为mysql

 

php编译参数

./configure \

--prefix=/lamp/php \

--with-apxs2=/lamp/apache/bin/apxs \

--with-mysql=/lamp/mysql \

--with-xmlrpc \

--with-openssl \

--with-zlib \

--with-freetype-dir \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-iconv=/usr/local/libiconv \

--enable-short-tags \

--enable-sockets \

--enable-zend-multibyte \

--enable-soap \

--enable-mbstring \

--enable-static \

--enable-gd-native-ttf \

--with-curl \

--with-xsl \

--enable-ftp \

--with-libxml-dir

常见错误:

Config_error:  please reinstall  libiconv ……

安装 libiconv-1.14.tar.gz     此文件下载地址:http://down.51cto.com/data/236053

#tar -jxvf libiconv-1.14.tar.gz

#cd libiconv-1.14

# ./configure   –-prefix=/usr

# make && make install