setup.linux

yum -y install gcc
yum -y install gcc+ gcc-c++
yum install python
yum install python-dev
yum install openssl openssl-develyum install  libjpeg-devel freetype-devel libpng-devel bzip2-devel  libxml2-devel openssl openssl-devel

wget http://labs.renren.com/apache-mirror//apr/apr-1.4.2.tar.gz
./configure --prefix=/usr/local/apr-httpd/

http://labs.renren.com/apache-mirror//apr/apr-util-1.3.9.tar.gz
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/


wget http://apache.freelamp.com//httpd/httpd-2.2.16.tar.gz
./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max --enable-so

wget http://apache.freelamp.com//httpd/httpd-2.3.6.tar.gz
./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max --enable-so --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd


wget http://mirrors.sohu.com/mysql/MySQL-6.0/mysql-6.0.11-alpha.tar.gz
./configure --prefix=/usr/local/mysql --with-unix-socket-path=/usr/local/mysql/var/mysql.sock --with-mysqld-user=mysql --with-charset=utf8 --with-extra-charsets=all --with-federated-storage-engine --with-named-curses-libs=/usr/lib/libncurses.so.5 --without-plugin-falcon

wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
./configure -prefix=/usr/local/ncurses -with-shared -without-debug

wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
./configure --prefix=/usr/local/gd --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg

#http://oss.org.cn/ossdocs/gnu_linux/lfs/blfs-1.0/general/libxml2.html
wget http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.5/libxml2-2.5.6.tar.bz2
./configure --prefix=/usr/local/libxml2
export path=/usr/local/libxml2/bin:$path

wget http://cn.php.net/get/php-5.3.3.tar.gz/from/cn2.php.net/mirror
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php  --with-gd=/usr/local/gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-bz2 --with-inifile --with-hyperwave --enable-xml --enable-track-vars --enable-dba --enable-dbase --enable-filepro --enable-ftp --enable-versioning --enable-memory-limit --enable-calendar --enable-session --enable-sockets --enable-sysmsg  --enable-mbstring


php.ini
register_globals = On
查找<IfModule mod_mime.c>; 

在此范围添加 

AddType application/x-httpd-php .php 
AddType application/x-httpd-php-source .phps 

 

然CPOPY PHP的配置文件

cp ../php4.3.4/php.ini.dist /usr/local/php/lib/php.ini 

修改php.ini文件
register_globals = On


ok!重新启动一下apache服务器 
/usr/local/apache/bin/apachectl restart 

然后写个php测试页info.php:内容如下 

<?php 
phpinfo(); 
?>; 
yum -y install libmcrypt
yum -y install libmcrypt-devel
  然后再重新编译PHP,加上编译参数:--with-mcrypt

最后一步重新启动apache报如下错误:
httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied

原因:是Linux有一个SELinux保护模式引起的。

解决办法:

1关闭SELINUX的方法:
vi /etc/selinux/config 将SELINUX=enforcing 改成SELINUX=disabled 需要重启
这个方法可能会对服务器带来风险。

2不关闭SELINUX的方法:
# setenforce 0
# chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /usr/local/apache/modules/libphp5.so
# service httpd restart
# setenforce 1


wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.6/phpMyAdmin-3.3.6-all-languages.tar.gz?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Fdownloads.php&ts=1283156374&use_mirror=jaist


-----------------------------------------------------------------------------

[root@localhost src]# rpm -e --nodeps MySQL-server-community-5.1.46-1.rhel5
[root@localhost src]# rpm -e --nodeps MySQL-cilent-community-5.1.46-1.rhel5


安装mysql的rpm包,如何卸载干净。
rpm -qpl MySQL-server-community-5.1.46-1.rhel5 确认mysql rpm的安装情况是否安装,
rpm -qa|grep -i MySQL 来查找MySQL的安装位置。


最后通过
rpm -e --nodeps MySQL-cilent-community-5.1.46-1.rhel5
rpm -e --nodeps MySQL-server-community-5.1.46-1.rhel5
记住两个命令都需要执行。
完成以后,可以通过find / -name mysql
来查看是否已卸载完毕。

猜你喜欢

转载自sunchaohui-koko.iteye.com/blog/752853