apache mysql php Ô´Âë±àÒëʹÓ÷½·¨

5年以前  |  阅读数:961 次  |  编程语言:PHP 

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

ÉeÖÃĬÈϵÄ×Ö*u¼¯UTF-8£º

character-set-server=utf8
collation-server=utf8_general_ci
default-character-set=utf8

mysqlÆo¶¯Óû§

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¡£ÀýÈç Ö÷Ŀ¼λÖãº

 相关文章:
PHP分页显示制作详细讲解
SSH 登录失败:Host key verification failed
获取IMSI
将二进制数据转为16进制以便显示
获取IMEI
文件下载
贪吃蛇
双位运算符
PHP自定义函数获取搜索引擎来源关键字的方法
Java生成UUID
发送邮件
年的日历图
提取后缀名
在Zeus Web Server中安装PHP语言支持
让你成为最历害的git提交人
Yii2汉字转拼音类的实例代码
再谈PHP中单双引号的区别详解
指定应用ID以获取对应的应用名称
Python 2与Python 3版本和编码的对比
php封装的page分页类完整实例