以下的文章主要介绍的是在linux操作系统之下对mysql+php5+Apache安装手记的具体描述,我前两天在相关网站看见Mysql+php5+apache安装手记的资料,觉得挺好,于是就拿出来供大家分享。
下载官方推荐的稳定版本httpd-2.2.3.tar.gz,
安装apache2
- #./configure –prefix=/usr/local/apache2 –enable-module=alias –enable-module=most \
- –enable-module=vhost_alias –enable-shared=vhost_alias –enable-module=so –enable-shared=max
- # make;make install
下载目前最新稳定版本mysql-standard-5.0.27-linux-i686-glibc23.tar.gz
无需安装,解压后移至/usr/local/mysql.
# groupadd mysql #建立mysql组
# useradd mysql -g mysql #建立mysql用户并且加入到mysql组中
# cd /usr/local/mysql
然后设置权限
- # chown -R root . #设定root能访问/usr/local/mysql
- # chown -R mysql data #设定mysql用户能访问/usr/local/mysql/data ,里面存的是mysql的数据库文件
- # chown -R mysql data/. #设定mysql用户能访问/usr/local/mysql/data下的所有文件
- # chown -R mysql data/mysql/. #设定mysql用户能访问/usr/local/mysql/data/mysql下的所有文件
- # chgrp -R mysql . #设定mysql组能够访问/usr/local/mysql
运行mysql:
- # /usr/local/mysql/bin/mysqld_safe –user=mysql &
修改root密码,默认为空:
- /usr/local/mysql/bin/mysqladmin -u root password ‘newpassword’
MYSQL+php5+apache安装完成
下载最新稳定版本php-5.1.6.tar.gz,
1. 安装zlib (安装libpng和gd前需要先安装zlib),
- # tar zxvf zlib-1.2.3.tar.gz
- # cd zlib-1.2.3
- # ./configure
- # make;make install
2. 安装libpng,
- # tar zxvf libpng-1.2.12.tar.gz
- # cd libpng-1.2.12
- # ./configure
- # make;make install
3. 安装freetype,
- # tar zxvf freetype-2.2.1.tar.gz
- # cd freetype-2.1.10
- # ./configure –prefix=/usr/local/freetype
- # make;make install
4. 安装jpeg,
- # tar zxvf jpegsrc.v6b.tar.gz
- # cd jpeg-6b
- # mkdir /usr/local/jpeg
- # mkdir /usr/local/jpeg/bin
- # mkdir /usr/local/jpeg/lib
- # mkdir /usr/local/jpeg/include
- # mkdir /usr/local/jpeg/man
- # mkdir /usr/local/jpeg/man/man1
- # ./configure –prefix=/usr/local/jpeg –enable-shared –enable-static
- # make;make install
5. 安装gd,
- # tar zxvf gd-2.0.33.tar.gz
- # cd gd-2.0.33
- # ./configure –prefix=/usr/local/gd –with-jpeg=/usr/local/jpeg –with-freetype=/usr/local/freetype –with-png –with-zlib
Mysql+php5+apache编译过程中会看到如下信息
** Configuration summary for gd 2.0.33:
- Support for PNG library: yes
- Support for JPEG library: yes
- Support for Freetype 2.x library: yes
- Support for Fontconfig library: no
- Support for Xpm library: no
- Support for pthreads: yes
可以看到png 、 jpeg 、 freetype都已经安装上了
- # make
- # make install
6. 正式安装php
- # tar zxvf php-5.1.6.tar.gz
- # cd php-5.1.6
- # ./configure –prefix=/usr/local/php5 –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=
/usr/local/mysql –with-gd –with-zlib –with-png –with-jpeg –with-freetype
–enable-sockets –with-iconv –enable-mbstring –enable-track-vars –enable-force-cgi-redirect –with-config-file-path=/usr/local/php5/etc
7.整合php和apache
- cp php.ini-dist /usr/local/php5/etc/php.ini
- vi /usr/local/php5/etc/php.ini
将extension=php_mysql.dll前面的#去掉
8. 安装ZendOptimizer,
- # tar zxvf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
- # cd ZendOptimizer-3.0.1-linux-glibc21-i386
- # ./install.sh
安装操作: [ok] -> [EXIT] -> [YES] -> [/httpd/zend] -> [/httpd/apache/conf] -> [yes] -> [OK] -> [OK] -> [NO]
遇到的一些错误解决:
1.php5在configure时提示:confi
关键词标签:Mysql,php5,apache,li
相关阅读
热门文章 10款MySQL数据库客户端图形界面管理工具推荐MySQL常用维护管理工具Linux VPS/服务器上轻松导入、导出MySQL数据MySQL复制的概述、安装、故障、技巧、工具
人气排行 MySQL数据库启动失败1067进程意外终止的解决办法总结Mysql 1045错误解决办法10款MySQL数据库客户端图形界面管理工具推荐MySQL服务器进程CPU占用100%解决办法MySQL导出导入命令的用例MySQL无法启动、无法停止各种解决方法总结三种常用的MySQL建表语句Mysql清空表的实现方法
查看所有0条评论>>