编译Apache\ PHP\ Mysql 注意的选项

来源:互联网 发布:变号王软件免费下载 编辑:程序博客网 时间:2024/04/30 15:31

First Step:  编译安装Apache::httpd-2.2.22.tar.gz

# ./configure --prefix=/usr/local/apache2 --enable-so

启动apache报错:cannot restore segment prot after reloc: Permission denied

解决的办法是在root用户下,修改/etc/selinux/config 文件,把SELINUX=enforcing 改成 SELINUX=disabled。另外还有一个暂时关闭的方法,就是 /usr/sbin/setenforce 0。

 

 

Second Step:

编译安装Mysql::mysql-5.1.52.tar.gz

(1)创建必要的组合拥有者

# groupadd mysql

# useradd -g mysql mysql

(2)配置、生成并安装Mysql

# ./configure --prefix=/usr/local/mysql --datadir=/usr/local/mysql/data --with-extra-charsets=all --localstatedir=/usr/local/mysql/data --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock

Compile Error: ./configure时出现错误:error: No curses/termcap library found

检查 ncurses 和 ncurses-devel 这两个包安装没有,应该是少一个包,系统一般默认ncurses是安装的,而 ncurses-devel 没有安装。

****安装mysql的时候,发现这个rm: cannot remove `libtoolT': No such file or directory 但是libtool已经安装

在网上找了半天 解决方法:

在执行./configure 之前,先执行:

# autoreconf --force --install
# libtoolize --automake --force
# automake --force --add-missing

后台发现autoreconf未按照:The program 'autoreconf' can be found in the following 

因为没有安装
  automake 工具, 
  sudo apt-get install autoconf automake libtool

 

# make && make test && make install

(3) 将配置文件(my.cnf)复制到典型位置,并设置其所有关系。

# cp /usr/local/mysql/data/mysql/my-medium.cnf /usr/local/mysql/my.cnf

# chown -R mysql .

# chgrp -R mysql .

(4)安装Mysql数据库

# /usr/local/mysql/bin/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf --user=mysql

(5)更新安装权限

# chown -R root .

# chown -R mysql data

(6)启动数据库

# /usr/local/mysql/bin/mysqld_safe --user=mysql &

 

 

Third Step: 编译安装PHP

# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-gd --enable-gd-native-ttf --with-zlib --with-png-dir=/usr/include --with-jpeg-dir=/usr/include --with-freetype-dir=/usr/include --enable-sockets --enable-mbstring

 

编译PHP为apache加载的module :  --with-apxs2=/usr/local/apache2/bin/apxs

编译PHP通过DLL连接MYSQL数据库:  --with-mysql=/usr/local/mysql

编译PHP通过mysqli类连接数据库:  --with-mysqli=/usr/local/mysql/bin/mysql_config

 

PHP 支持图片验证码,添加GD库的步骤如下:

1. 安装zlib

2. 安装libpng

3. 安装freetype

4. 安装Jpeg

5. 安装GD

6. 重新编译PHP

 

PHP 支持mb_substr() 步骤如下:

1. 安装 php-mbstring-5.1.6-15.el5.i386.rpm

2. 重新编译PHP添加参数: --enable-mbstring

 

 

 

其它选项稍后再补充。。。

 

原创粉丝点击