apache-mysql-php安裝與配置

來源:互聯網
上載者:User

標籤:des   http   io   ar   os   sp   檔案   on   art   

################## APACHE ###############
#./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr-1.5/bin/apr-1-config --with-apr-util=/usr/local/apr-util-1.5/bin/apu-1-config -enable-so --enable-dav --enable-maintainer-mode --enable-rewrite --with-pcre=/usr/local/pcre-8.35/bin/pcre-config
#make;make install

apache 作為linux啟動就運行服務程式
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
但是在執行:
chkconfig --add httpd
chkconfig httpd on
的時候出現錯誤:service httpd does not support chkconfig
解決辦法:
開啟 vi /etc/rc.d/init.d/httpd 添加(#!/bin/sh下面)
#chkconfig: 2345 10 90
#description: Activates/Deactivates Apache Web Server
加上上面這兩行就可以,#必須有


################## MySQL ###############
#groupadd mysql
#useradd -r -g mysql mysql
# Beginning of source-build specific instructions
#tar zxvf mysql-VERSION.tar.gz
#cd mysql-VERSION
#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH
_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_gene
ral_ci
#make
#make install
# End of source-build specific instructions
# Postinstallation setup
#cd /usr/local/mysql
#chown -R mysql .
#chgrp -R mysql .
#scripts/mysql_install_db --user=mysql
#chown -R root .
#chown -R mysql data

手動啟動MySQL。
#cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
#/etc/init.d/mysqld start
##或者
#service mysqld start

在上面的步驟後,開機自動啟動設定
#chkconfig --add mysqld
##有的系統需要下面的
#chkconfig --level 345 mysqld on

 

################## PHP ###############
php-5.6.2/ext/mysqli
#./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config
#make;make install

php-5.6.2/ext/pdo-mysql
#./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql/
#make;make install

#wget http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz
#./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2/
#make;make install
php-5.6.2/ext/xsl
#./configure --with-php-config=/usr/local/php/bin/php-config --with-xsl=/usr/local/libxslt/
#make;make install

#wget http://pecl.php.net/get/apcu-4.0.6.tgz
#./configure --with-php-config=/usr/local/php/bin/php-config --enable-apcu --enable-apc-bc
#make;make install

最後
#vi /usr/local/apache/conf/httpd.conf 用於解釋PHP檔案
#php parse supported
<FilesMatch "\.ph(p[2-6]?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>

# .phps with PHP source filter parse
#<FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
#</FilesMatch>

簡單測試
#touch phpinfo.php
#vi phpinfo.php
<?php
phpinfo();
?>
#輸入:http://localhost/phpinfo.php

 

apache-mysql-php安裝與配置

聯繫我們

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