近期整理了一套APACHE+MYSQL+PHP环境搭建
希望对LINUX爱好者有一定的帮助
里面参数就不多介绍了
<APACHE+PHP+MYSQL 下载路径>
系统推荐是 CENT OS5.7 CENT OS 6.0
==http://ftp.linux.co.kr/pub/mysql/mysql-5.0.22.tar.gz
==http://ftp.linux.co.kr/pub/php/php-4.4.4.tar.gz
==http://ftp.linux.co.kr/pub/apache/httpd-2.0.54.tar.gz、
yum install gcc* gd* libxml2* flex
=================================APCHE========================================
1. tar zxvf httpd-2.0.54.tar.gz
2. cd httpd-2.0.54
3. ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite=shared --enable-speling=shared --enable-modules=all
4 yum install gcc* #安装GCC插件
5. make 编译
6. make install
7. vi /usr/local/apache/conf/httpd.conf
CheckSpelling on 在第一行加入此语句 是解决APACHE 网站 大小字不统一的问题
================================MYSQL=========================================
1. tar zxvf mysql-5.0.22.tar.gz
2. cd mysql-5.0.22
3. ./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-charset=gbk --with-xcharset=all
当提示此错误时
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found
解决方法:yum install libtermcap-devel -y 安装termcap开发包
4.make make install
5./usr/local/mysql/bin/mysql_install_db
6.groupadd -g 20000 mysql
7.useradd -u 20000 -g mysql mysql
8.chown -R mysql:mysql /var/lib/mysql
9.cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
10./usr/local/mysql/bin/mysqld_safe --user=mysql &
数据库启动错误、无法启动的时候
netstat -an 出现 数据库无法启动 先查看进程 ps -A | grep mysql
然后 kill掉 mysql进程
=================编辑vim /etc/my.cnf #skip-federated
11./usr/local/mysql/bin/mysqladmin -u root -p password
1. tar zxvf php-4.4.4.tar.gz
2. cd php-4.4.4
YUM 安装 FLEX libjpeg libpng gd
3. ./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-gd=/usr --with-gd-lib=/usr/lib --with-jpeg-dir=/usr --with-png-dir=/usr/include/ --with-zlib --enable-mbstring --enable-iconv
4. make && make install
5. cp php.ini-dist /usr/local/lib/php/php.ini
6. vi /usr/local/apache/conf/httpd.conf
找到AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz 在下面添加:
AddType application/x-httpd-php .php .html .htm
AddType application/x-httpd-php-source .phps index.htm index.php index.php3
tar zxvf libiconv-1.9.1.tar.gz
cd libiconv-1.9.1
./configure --prefix=/usr/local/modules/iconv
make
make install
php路径 --with-iconv=/usr/local/modules/iconv