apache+mysql+php 源碼安裝

來源:互聯網
上載者:User

1.httpd-2.2.3.tar.gz
gunzip < httpd-2.2.3.tar.gz |tar -xvf -
cd httpd-2.2.3
./configure
make
make install

啟動:/usr/local/apache2/bin/apachectl start

2.mysql-5.0.22.tar.gz
groupadd mysql
useradd -g mysql mysql
gunzip < mysql-5.0.22.tar.gz |tar -xvf -
cd mysql-5.0.22
./configure --prefix=/usr/local/mysql --with-charset=gb2312
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user=mysql //用來安裝資料庫檔案
chown -R root
chown -R mysql var
chgrp -R mysql
啟動 bin/mysqld_safe --user=mysql &

3.php-5.2.0.tar.gz
gunzip < php-5.2.0.tar.gz |tar -xvf -
cd php-5.2.0
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --enable-track-vars --enable-force-cgi-redirect --with-config-file-path=/usr/local/apache/conf
make
make install
cp php.ini-dist /usr/local/apache/lib/php.ini

 編輯php.ini檔案:
尋找:
;default_charset = "iso-8859-1"
在這行下面加一行
default_charset = "gb2312"

# 編輯apache的 httpd.conf檔案:
尋找:
DirectoryIndex index.html
在後面加入 index.php 讓apache也能開啟預設首頁為php的檔案。
尋找:
#AddType application/x-tar .tgz
在下面加入
AddType application/x-httpd-php .php

重啟apache 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.