apache-mysql-php安裝與配置

################## 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 installphp

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


################## 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 datalinux

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

在上面的步驟後,開機自動啓動設置
#chkconfig --add mysqld
##有的系統須要下面的
#chkconfig --level 345 mysqld onapache

 

################## 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 installapp

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 installui

#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.net

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

# .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

相關文章
相關標籤/搜索