看到很多人做这些存在问题,现在贴出来,不一定有针对性,只是作为参考。
OS就不说了,ubuntu,amp都是源码安装,自己机器开发用的,比较基本,没有优化,
下面是未经处理的,包括目录。
APACHE 2.2:
shell> sudo apt-get install zlib1g-dev
shell> ./configure --prefix=/opt/server/apache2 --enable-so \
--enable-modules=all --enable-mods-shared=all
shell> make
shell> sudo make install
# 启动
shell> sudo /opt/server/apache2/bin/apachectl start
MYSQL 5.0:
shell> sudo apt-get install libncurses5-dev
shell> sudo groupadd mysql
shell> sudo useradd -g mysql mysql
shell> ./configure --prefix=/opt/server/mysql5 --enable-so \
--with-extra-charsets=binary,ascii,gbk,gb2312,utf8 --enable-assembler \
--with-pthread --enable-thread-safe-client --without-debug \
--with-unix-socket-path=/tmp/mysql.sock
shell> make
shell> sudo make install
shell> sudo cp support-files/my-medium.cnf /etc/my.cnf
shell> sudo cp support-files/mysql.server /opt/server/mysql5/bin/mysqldctl
shell> cd /opt/server/mysql5
shell> sudo chmod a+x bin/mysqldctl
shell> sudo chown -R mysql:mysql .
shell> sudo bin/mysql_install_db --user=mysql
shell> sudo bin/mysqld_safe --user=mysql &
shell> sudo ./bin/mysqladmin -u root password "hsqhsq"
# 杀掉mysqld相关的2个进程
shell> sudo /opt/server/mysql5/bin/mysqldctl start --user=mysql
shell> /opt/server/mysql5/bin/mysql -hlocalhost -uroot -p<pwd> <db_name>
PHP 5.2:
# 先是一些以来的库
libiconv:
shell> ./configure --prefix=/opt/server/lib/libiconv
shell> make
shell> sudo make install
freetype:
shell> ./configure --prefix=/opt/server/lib/freetype
shell> make
shell> sudo make install
jpegsrc:
shell> ./configure --enable-static --enable-shared
shell> make
shell> sudo make install
gd:
shell> ./configure --prefix=/opt/server/lib/gd --with-freetype=/opt/server/lib/freetype --with-jpeg --with-png
shell> make
shell> sudo make install
libxml2:
shell> ./configure --prefix=/opt/server/lib/libxml
shell> make
shell> sudo make install
# 开始php,尽量把扩展编译成共享库
shell> ./configure --prefix=/opt/server/php5 \
--with-apxs2=/opt/server/apache2/bin/apxs \
--with-libxml-dir=/opt/server/lib/libxml \
--with-config-file-path=/opt/server/php5/etc \
--enable-shared --disable-debug --enable-inline-optimization \
--enable-fastcgi --enable-force-cgi-redirect \
--disable-ctype --disable-dom --disable-filter[pcre] --disable-hash --without-iconv \
--disable-json --disable-pdo --disable-posix \
--disable-session --without-sqlite \
--disable-tokenizer --disable-xmlreader --disable-xmlwriter
# 默认开启 #
# date standard
# --without-pcre-regex --disable-xml --disable-libxml
# pear 依赖于 pcre 和 xml,xml 依赖于 libxml
# --without-pdo-sqlite 似是无效选项
# --disable-reflection --disable-spl 似乎导致 make 出错
# --disable-simplexml[libxml2] 导致SPL无法加载
# 默认开启 #
# 附:编译PHP之后,为PHP添加扩展的方法。(本步骤可选)
# cd php-5.2.4/pcntl
# /opt/server/php5/bin/phpize
# ./configure --with-php-config=/opt/server/php5/bin/php-config
# make && sudo make install
# cd ../../../
# vi /usr/local/webserver/php/etc/php.ini
# 修改extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"
OS就不说了,ubuntu,amp都是源码安装,自己机器开发用的,比较基本,没有优化,
下面是未经处理的,包括目录。
APACHE 2.2:
shell> sudo apt-get install zlib1g-dev
shell> ./configure --prefix=/opt/server/apache2 --enable-so \
--enable-modules=all --enable-mods-shared=all
shell> make
shell> sudo make install
# 启动
shell> sudo /opt/server/apache2/bin/apachectl start
MYSQL 5.0:
shell> sudo apt-get install libncurses5-dev
shell> sudo groupadd mysql
shell> sudo useradd -g mysql mysql
shell> ./configure --prefix=/opt/server/mysql5 --enable-so \
--with-extra-charsets=binary,ascii,gbk,gb2312,utf8 --enable-assembler \
--with-pthread --enable-thread-safe-client --without-debug \
--with-unix-socket-path=/tmp/mysql.sock
shell> make
shell> sudo make install
shell> sudo cp support-files/my-medium.cnf /etc/my.cnf
shell> sudo cp support-files/mysql.server /opt/server/mysql5/bin/mysqldctl
shell> cd /opt/server/mysql5
shell> sudo chmod a+x bin/mysqldctl
shell> sudo chown -R mysql:mysql .
shell> sudo bin/mysql_install_db --user=mysql
shell> sudo bin/mysqld_safe --user=mysql &
shell> sudo ./bin/mysqladmin -u root password "hsqhsq"
# 杀掉mysqld相关的2个进程
shell> sudo /opt/server/mysql5/bin/mysqldctl start --user=mysql
shell> /opt/server/mysql5/bin/mysql -hlocalhost -uroot -p<pwd> <db_name>
PHP 5.2:
# 先是一些以来的库
libiconv:
shell> ./configure --prefix=/opt/server/lib/libiconv
shell> make
shell> sudo make install
freetype:
shell> ./configure --prefix=/opt/server/lib/freetype
shell> make
shell> sudo make install
jpegsrc:
shell> ./configure --enable-static --enable-shared
shell> make
shell> sudo make install
gd:
shell> ./configure --prefix=/opt/server/lib/gd --with-freetype=/opt/server/lib/freetype --with-jpeg --with-png
shell> make
shell> sudo make install
libxml2:
shell> ./configure --prefix=/opt/server/lib/libxml
shell> make
shell> sudo make install
# 开始php,尽量把扩展编译成共享库
shell> ./configure --prefix=/opt/server/php5 \
--with-apxs2=/opt/server/apache2/bin/apxs \
--with-libxml-dir=/opt/server/lib/libxml \
--with-config-file-path=/opt/server/php5/etc \
--enable-shared --disable-debug --enable-inline-optimization \
--enable-fastcgi --enable-force-cgi-redirect \
--disable-ctype --disable-dom --disable-filter[pcre] --disable-hash --without-iconv \
--disable-json --disable-pdo --disable-posix \
--disable-session --without-sqlite \
--disable-tokenizer --disable-xmlreader --disable-xmlwriter
# 默认开启 #
# date standard
# --without-pcre-regex --disable-xml --disable-libxml
# pear 依赖于 pcre 和 xml,xml 依赖于 libxml
# --without-pdo-sqlite 似是无效选项
# --disable-reflection --disable-spl 似乎导致 make 出错
# --disable-simplexml[libxml2] 导致SPL无法加载
# 默认开启 #
# 附:编译PHP之后,为PHP添加扩展的方法。(本步骤可选)
# cd php-5.2.4/pcntl
# /opt/server/php5/bin/phpize
# ./configure --with-php-config=/opt/server/php5/bin/php-config
# make && sudo make install
# cd ../../../
# vi /usr/local/webserver/php/etc/php.ini
# 修改extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"
0
上一篇:没有了
下一篇:没有了
下一篇:没有了
