Linux環境配置之LAMP搭建(源碼安裝)

來源:互聯網
上載者:User

系統內容:CenOS5

所用軟體:

安裝步驟:

注意:我所使用的軟體都存放在/root/software檔案夾下

第一步:mysql安裝

cd /root/software

tar -zxvf mysql-...

cd mysql...

more INSTALL-SOURCE(查看協助文檔)


按照協助文檔進行安裝,安裝完成後 執行ps -ef |grep mysql 查看mysql是否已經啟動,OK!mysql的安裝就到此完成可以通過bin/mysql -u root登陸mysql

第二步php安裝

cd /root/software(回到我的軟體存放目錄)

tar zxvf php-...

cd php-...

more INSTALL(查看協助文檔,找到Apache 2.0 on Unix systems,同樣根據安裝文檔一步一步安裝)

cd /root/software

tar zxvf httpd-...

cd httpd-...

./configure --enable-so

make

make install

/usr/local/apache2/bin/apachectl start(啟動apache)

ps -ef | grep httpd(查看apache是否啟動成功)

cd ../php-...

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql

make

make install

cp php.ini-dist /usr/local/lib/php.ini

cd /usr/local/apache2/conf

vi httpd.conf(編輯設定檔,添加 AddType application/x-httpd-php .php .phtml)

cd ../

bin/apachectl restart(重啟apache)

報錯:httpd: Syntax error on line 53 of
/usr/local/apache2/conf/httpd.conf: Cannot load
/usr/local/apache2/modules/libphp5.so into server:
/usr/local/apache2/modules/libphp5.so: cannot restore segment prot after
reloc: Permission denied

根據第二個方法設定,重啟Apache,OK

一切搞定

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.