对于web开发,LAMP应该是经常要安装的东东了。由于服务器扩展,常常需要相同编译设置进行扩展。可由于时间久远,编译参数也许早就忘了,没关系。这里介绍一种简单的查看编译参数的方法。

对于apache服务器,假设安装目录:/usr/local/apache

  1. [root@ www.linuxidc.com apache]# cd /usr/local/apache/  
  2. [root@ www.linuxidc.com apache]# cd build/  
  3. [root@ www.linuxidc.com build]# cat config.nice   

       通过上面几步操作,如果幸运的话,你应该看到类似下面的结果:

  1. [root@ www.linuxidc.com build]# cat config.nice   
  2. #! /bin/sh  
  3. #  
  4. # Created by configure  
  5.   
  6. "./configure" \  
  7. "--prefix=/usr/local/apache" \  
  8. "--enable-so" \  
  9. "--enable-rewrite" \  
  10. "--enable-cgi" \  
  11. "--enable-vhost-alias" \  
  12. "--enable-ssl" \  
  13. "--enable-cache" \  
  14. "--enable-mem-cache" \  
  15. "$@"  

        好了,apache的已经搞定。下面来看看mysql的吧!假如你的mysql目录为:/usr/local/mysql

  1. [root@localhost bin]$ cd /usr/local/mysql/  
  2. [root@localhost mysql]$ cd bin/  
  3. [root@localhost bin]$ cat mysqlbug | grep configure  

       通过上面操作,可以看到类似如下结果:    

  1. [root@localhost bin]$ cat mysqlbug | grep configure  
  2. # This is set by configure  
  3. CONFIGURE_LINE="./configure  '--prefix=/usr/local/mysql' '--localstatedir=/usr/local/mysql/data' '--libexecdir=/usr/local/mysql/bin' '--with-comment=MySQL Community Server (GPL)' '--with-server-suffix=' '--enable-thread-safe-client' '--enable-local-infile' '--with-pic' '--with-fast-mutexes' '--with-client-ldflags=-static' '--with-mysqld-ldflags=-static' '--with-zlib-dir=bundled' '--with-big-tables' '--with-ssl' '--with-readline' '--with-embedded-server' '--with-partition' '--with-innodb' '--without-ndbcluster' '--with-archive-storage-engine' '--with-blackhole-storage-engine' '--with-csv-storage-engine' '--without-example-storage-engine' '--with-federated-storage-engine' '--with-extra-charsets=complex' 'CC=ccache /usr/local/gcc-4.3.2/bin/gcc -static-libgcc' 'CFLAGS=-g -O3' 'CXX=ccache /usr/local/gcc-4.3.2/bin/gcc -static-libgcc' 'CXXFLAGS=-g -O3'"  

         假设php目录为:/usr/local/php

  1. [root@localhost build]# cd /usr/local/php/  
  2. [root@localhost php]# cd bin/  
  3. [root@localhost bin]# ./php -i | grep configure  
  4. Configure Command =>  './configure'  '--prefix=/usr/local/php' '--enable-fastcgi' '--enable-force-cgi-redirect' '--with-mysql=/opt/mysql' '--enable-sockets' '--with-mime-magic' '--enable-mbstring' '--with-iconv' '--with-ttf' '--enable-ftp' '--with-curl' '--with-bz2' '--enable-calendar'  

通过上面的方法,apache,mysql和php编译参数都搞定了。