linux °ae±¾ £º ubuntu 12.04
½ñÌiÍe³ÉÁË php mysql ºÍapache µÄÅaÖÃ
Ö÷ÒªÊÇÔ´ÂeÅaÖã¬
apache Ö÷ÒªÊÇ 2.4.2 °ae±¾
php Ö÷ÒªÊÇ 5.3.11 °ae±¾
mysql Ö÷ÒªÊÇ 5.1.62 °ae±¾
Ç°¼¸ÌiÊÔÁ˺ü¸´Î£¬³oÏÖÁËÈi¼þµÄÔ´³aÍ»£¬ÎÒ*ÅÁËÁ½¸oÔ´ÔÚͬһ¸osourceÀi£¬ºoÐ޸ĺo£¬°²×°Ã»³oÏÖ´oµÄÎÊÌa¡£
×ܵÄÇe¿oÈçÏÂ.
ÎÒÍe³ÉµÄ¹ý³ÌÈçÏ £º
apache ÅaÖãº
./configure --prefix=/usr/local/apache/ --with-libxml2 --enable-modules
=most --enable-mods-shared=all
¿´Õaapache ¾µaʵÀýдµÄ¡£
ÔÚubuntuÉϼÓÉÏlibxml2×iеİae±¾£¬È»ºoÒ»ÇÐok
make
make install
È»ºo ÊaÈe127.0.0.1 ¿ÉÒÔ¿´¼uit¡®s work£¡
mysqlÅaÖãº
cd mysql
sudo ./configure ¨Cprefix=/usr/local/mysql ¨Cwith-mysqld-user=mysql
¨Cwith-extra-charsets=all ¨Cenable-thread-safe-client
ÔÚ./configure ÅaÖÃÖÐСÐĵa£¬²¢ÇÒСÐÄÆaÖеÄÌaʾ
ÎÒ±aÊÇÔÚСÖжȹýÄǸo./configure µÄ£¬È»ºo¾ÍÊÇ˳ÀuµÄ
make
make install
ÓÉÓÚÒªÅaÖÃÎļþ¸´ÖƵ½etcĿ¼ÏÂ
sudo cp /mypath/mysql /etc/my.cnf
[mysqld]# ÉeÖÃĬÈÏΪINNODB±i£¬Ö§³ÖÊÂÎñ£ºdefault-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
default-character-set=utf8
user=mysql
[client]
default-character-set=utf8
ΪÁËÈÃÆÕͨµÄÓû§Æo¶¯mysql ¸³ÓemysqlĿ¼ÈçÏÂȨÏÞ
sudo chown -R mysql£ºmysql /usr/local/mysql
È»ºo£¬Çл»µ½mysqlµÄÓû§Ï£¬*¢ÏÖmysqlÆo¶¯ÁË
ps aux | grep mysqld
Èç¹uÓÐ /usr/local/mysql/bin/ ¡£¡£¡£ ˵Ã÷Æo¶¯ÁËmysql£¬mysqlÅaÖÃok
ÔÚ
Php ÅaÖãº
×i¸´ÔÓµÄÊophpµÄÅaÖ㬹ؼuÔÚÓÚÄǸoÄ£¿eÓеa¶a
ÅaÖúͰ²×°µÄʱ¼aÓеa³¤£¬ÓÐʱºo ÎÒ»¹ÈÏΪÊÇËÀ»uÄØ£¿
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql-dir=/usr/local/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--with-pdo-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--enable-mod-charset \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-curlwrappers \
--enable-exif \
--enable-ftp \
--with-gdbm \
--with-gd=shared \
--with-ttf \
--enable-gd-native-ttf \
--with-gettext \
--with-gmp \
--enable-mbstring=all \
--enable-zend-multibyte \
--with-ming=shared \
--enable-sqlite-utf8 \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-xmlrpc \
--with-xsl \
--enable-zip \
--with-zlib \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-magic-quotes \
--enable-sigchild \
--with-ncurses \
--enable-pcntl
È»ºoconfigureÖб¨³oȱÉٺöa×e¼þ£¬°¦¡£¡£ Ò»¸oÒ»¸oÌiÉÏ ÀýÈç bz2 ºÍzlib ºÍncurses Èý¸o×e¼þÌi¼ÓÍeºo
configure Á¢¼´³É¹¦ÁË£¬È»ºoÄØ£¿ make ok make test ³oÎÊÌa¡£¡£¡£¡£¡££¿£¿ ÎÞÓiÁ˵«ÊÇ make install
ok
¾ÍÐeÒª¶Ôphp ÅaÖÃÁË
½¨Á¢ php.ini Îļþ¡£
дÈeÈçϵÄÅaÖãº
error_log = /usr/local/php/php_error.log
date.timezone = "Asia/ShangHai"
session.save_path = "/tmp"
¶Ôconf/httpd.conf ÐÞ¸ÄÔÚ LoadModules php5_modules modules/libphp5.so ÌiÉÏ
AddType application/x-httpd-php .php .html
AddType application/x-httpd-php-source .phps
apacheÆaËuÅaÖÃÐÅϢҲдÔÚhttpd.confÎļþÀi¡£ÀýÈç Ö÷Ŀ¼λÖãº