setup.linux
yum -y install gcc
yum-yinstallgcc+gcc-c++
yuminstallpython
yuminstallpython-dev
yum install openssl openssl-develyum install libjpeg-devel freetype-devel libpng-devel bzip2-devel libxml2-devel openssl openssl-develwget 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/
wgethttp://apache.freelamp.com//httpd/httpd-2.2.16.tar.gz
./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max --enable-sowget 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
wgethttp://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-falconwget 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
wgethttp://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:$pathwget 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-yinstalllibmcrypt
yum-yinstalllibmcrypt-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的方法:
#setenforce0
#chcon-c-v-R-usystem_u-robject_r-ttextrel_shlib_t/usr/local/apache/modules/libphp5.so
#servicehttpdrestart
# setenforce 1-----------------------------------------------------------------------------
[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-qplMySQL-server-community-5.1.46-1.rhel5确认mysqlrpm的安装情况是否安装,
rpm -qa|grep -i MySQL 来查找MySQL的安装位置。最后通过
rpm-e--nodepsMySQL-cilent-community-5.1.46-1.rhel5
rpm-e--nodepsMySQL-server-community-5.1.46-1.rhel5
记住两个命令都需要执行。
完成以后,可以通过find/-namemysql
来查看是否已卸载完毕。