对于web开发,LAMP应该是经常要安装的东东了。由于服务器扩展,常常需要相同编译设置进行扩展。可由于时间久远,编译参数也许早就忘了,没关系。这里介绍一种简单的查看编译参数的方法。
对于apache服务器,假设安装目录:/usr/local/apache
[root@ apache]# cd /usr/local/apache/ [root@ apache]# cd build/ [root@ build]# cat config.nice通过上面几步操作,如果幸运的话,你应该看到类似下面的结果:
[root@ build]# cat config.nice #! /bin/sh # # Created by configure "./configure" \ "--prefix=/usr/local/apache" \ "--enable-so" \ "--enable-rewrite" \ "--enable-cgi" \ "--enable-vhost-alias" \ "--enable-ssl" \ "--enable-cache" \ "--enable-mem-cache" \ "$@"
好了,apache的已经搞定。下面来看看mysql的吧!假如你的mysql目录为:/usr/local/mysql
[root@localhost bin]$ cd /usr/local/mysql/ [root@localhost mysql]$ cd bin/ [root@localhost bin]$ cat mysqlbug | grep configure
通过上面操作,可以看到类似如下结果:
[root@localhost bin]$ cat mysqlbug | grep configure # This is set by configure 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
[root@localhost build]# cd /usr/local/php/ [root@localhost php]# cd bin/ [root@localhost bin]# ./php -i | grep configure 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编译参数都搞定了。
如果你想查看nginx的编译参数信息,请参阅:查看服务器上安装的Nginx版本号