用户名: 密   码:
   飞诺网 加入收藏
飞诺网 网站开发 VBScript ASP Asp.net Jsp php XML CGI-Perl 搜索引擎 ajax web技术
PHP系列教程 PHP实例 php技术文档

您当前的位置:飞诺网 >> php >> php技术文档

我的[L]AMP安装记录

www.diybl.com    时间 : 2008-06-27  作者:佚名   编辑:本站 点击:   [ 评论 ]


看到很多人做这些存在问题,现在贴出来,不一定有针对性,只是作为参考。

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
如果图片或页面不能正常显示请点击这里
php技术文档推荐文章

文章评论