免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1433 | 回复: 1

我的[L]AMP安装记录 [复制链接]

论坛徽章:
0
发表于 2008-06-25 20:13 |显示全部楼层
看到很多人做这些存在问题,现在贴出来,不一定有针对性,只是作为参考。

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/"

# 下面是分别编译各扩展
# bcmath    filter   json        mysql      shmop    tidy
# bz2       ftp      mbstring    pcntl      soap     tokenizer
# calendar  gd       mcrypt      pdo_mysql  sockets  [xcache]
# ctype     gettext  [memcache]    pdo        sqlite   xmlreader
# curl      gmp      mhash       posix      sysvmsg  xmlwriter
# dom       hash     mime_magic  recode     sysvsem  xsl
# exif      iconv    mysqli      session     sysvshm  zip

cd ../bcmath
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-bcmath
make && sudo make install

cd ../bz2
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-bz2
make && sudo make install

cd ../calendar
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-calendar
make && sudo make install

cd ../ctype
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../curl
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-curl --with-curlwrappers
make && sudo make install

cd ../dom
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-libxml-dir=/opt/server/lib/libxml
make && sudo make install

cd ../exif
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-exif
make && sudo make install

cd ../filter
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../ftp
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-ftp
make && sudo make install

cd ../gd
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-gd-native-ttf --enable-gd-jis-conv --with-gd=/opt/server/lib/gd --with-freetype-dir=/opt/server/lib/freetype --with-jpeg-dir=/usr/local --with-png-dir=/usr
make && sudo make install

cd ../gettext
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-gettext
make && sudo make install

cd ../gmp
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-gmp
make && sudo make install

cd ../hash
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../iconv
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../json
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../mbstring
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-mbstring
make && sudo make install

cd ../mcrypt
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-mcrypt
make && sudo make install

cd ../mhash
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-mhash
make && sudo make install

cd ../mime_magic
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../mysql
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-mysql=/opt/server/mysql5/
make && sudo make install

cd ../mysqli
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-mysqli=/opt/server/mysql5/bin/mysql_config
make && sudo make install

cd ../pcntl
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-pcntl
make && sudo make install

cd ../pdo
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../pdo_mysql
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-pdo-mysql=/opt/server/mysql5/
make && sudo make install

cd ../pdo_sqlite
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../posix
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../recode
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-recode
make && sudo make install

cd ../session
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../shmop
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-shmop
make && sudo make install

cd ../soap
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-soap --with-libxml-dir=/opt/server/lib/libxml/
make && sudo make install

cd ../sockets
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-sockets
make && sudo make install

cd ../sqlite
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-sqlite-utf8
make && sudo make install

cd ../sysvmsg
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-sysvmsg
make && sudo make install

cd ../sysvsem
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-sysvsem
make && sudo make install

cd ../sysvshm
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-sysvshm
make && sudo make install

cd ../tidy
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-tidy
make && sudo make install

cd ../tokenizer
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config
make && sudo make install

cd ../xmlreader
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-libxml-dir=/opt/server/lib/libxml/
make && sudo make install

cd ../xmlwriter
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-libxml-dir=/opt/server/lib/libxml/
make && sudo make install

cd ../xsl
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --with-xsl
make && sudo make install

cd ../zip
/opt/server/php5/bin/phpize
./configure --with-php-config=/opt/server/php5/bin/php-config --enable-zip
make && sudo make install

[ 本帖最后由 hshq_cn 于 2008-6-26 09:50 编辑 ]

论坛徽章:
0
发表于 2008-06-25 21:48 |显示全部楼层
详细真
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP