您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 公司方案 > Linux AS4下PHP_APACHE_MYSQL整合安装过程
1Linux下PHP最新安装php5.2.9mysql5.0.45apache2.2.4环境:操作系统版本为AS43.0一、删除apache+php+mysql:判断是不是rpm安装如:rpm-qphp返回php版本,则是rpm安装,用rpm-ephp–nodeps即可彻底删除系统自带的php如果不返回PHP版本则是二进制安装,直接删除目录就可以!同理apachemysql也一样!二、安装apache下载httpd-2.2.4.tar.gztarxzvfhttpd-2.2.4.tar.gzcdhttpd-2.2.4./configure–prefix=/usr/local/apache2–enable-so–enable-mods-shared=all–enable-cgi–enable-rewrite–enable-deflate–with-mpm=workermakemakeinstall三、安装mysql#chmod755mysql-5.0.45-linux-i686-glibc23.tar.gz//设置mysql-5.0.45-linux-i686-glibc23.tar.gz属性为755#tarxzvfmysql-5.0.45-linux-i686-glibc23.tar.gz//解压#cp-rmysql-5.0.45-linux-i686-glibc23/usr/local//#cd/usr/local///在/usr/local下#mvmysql-5.0.45-linux-i686-glibc23mysql//把mysql-5.0.45-linux-i686-glibc23命名为mysql#cdmysql//#groupaddmysql//建立mysql组#useraddmysql-gmysql//建立mysql用户并且加入到mysql组中#cp/usr/local/mysql/support-files/my-medium.cnf/etc/my.cnf在support-files目录下有4个模版文件,我们选择其中一个座位Mysql的配置文件,覆盖/etc/my.cnf(系统默认的配置,其中设置了性能参数和Mysql的一些路径参数)#cd/usr/local/mysql进入mysql目录#./scripts/mysql_install_db--user=mysql//初试化表并且规定用mysql用户来访问。初始化表以后就开始给mysql和root用户设定访问权限#chown-Rroot/usr/local/mysql//设定root能访问/usr/local/mysql#chown-Rmysqldata//设定mysql用户能访问/usr/local/mysql/data里面存的是mysql的数据库文件.这个目录是在/etc/my.cnf中有配置,在mysql_install_db时产生。#chown-Rmysqldata///设定mysql用户能访问/usr/local/mysql/data/mysql下的所有文件#chgrp-Rmysql/usr/local/mysql//设定mysql组能够访问/usr/local/mysql#/usr/local/mysql/bin/mysqld_safe--user=mysql&运行mysql如果没有问题的话,应该会出现类似这样的提示:[1]42264#Startingmysqlddaemonwithdatabasesfrom/usr/local/mysql/var如果出现mysqlended这样的语句,表示Mysql没有正常启动,你可以到log中查找问题,Log文件的通常在/etc/my.cnf中配置。大多数问题是权限设置不正确引起的。#/usr/local/mysql/bin/mysqladmin-urootpasswordyourpassword//默认安装密码为空,为了安全你必须马上修改.#cpsupport-files/mysql.server/etc/rc.d/init.d/mysqld//设置使mysql每次启动都能自动运行,也可以在/etc/rc.d/rc.local文件中/usr/local/mysql/bin/mysqld_safe–-user=mysql&加上后面加下划线的可以不用做2#chmod700/etc/init.d/mysqld#chkconfig-–addmysqld#chkconfig–level345mysqldon#servicemysqldstart//启动mysqld服务#netstat-atln//查看3306端口是否打开。要注意在防火墙中开放该端口。四、安装php0.编译FreeTDS#tarzxvffreetds-0.82.tar.gz#cdfreetds-0.82//--with-tdsver=8.0是指安装tds8.0版本(如果没有加这个参数,则按照默认编译为5.0。5.0连接数据库的端口是4000,而不是SQLServer的1433)#./configure--prefix=/usr/local/freetds--with-tdsver=8.0#make#makeinstall#vi/etc/ld.so.conf设置系统动态库配置文件,加入以下:/usr/local/freetds/lib保存退出。#ldconfig重新加载动态库列表ld.so.conf#生成两个文件,后面PHP编译时需要touch/usr/local/freetds/include/tds.htouch/usr/local/freetds/lib/libtds.a1.安装zlib(安装libpng和gd前需要先安装zlib),#tarzxvfzlib-1.2.3.tar.gz#cdzlib-1.2.3#./configure#make;makeinstall2.安装libpng,#tarzxvflibpng-1.2.12.tar.gz#cdlibpng-1.2.12#./configure#make;makeinstall3.安装freetype,#tarzxvffreetype-2.2.1.tar.gz#cdfreetype-2.1.10#./configure–prefix=/usr/local/freetype#make;makeinstall#产生make:[install]Error1(ignored),可过去4.安装jpeg,#tarzxvfjpegsrc.v6b.tar.gz#cdjpeg-6b#mkdir/usr/local/jpeg3#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;makeinstall5.安装gd,#tarzxvfgd-2.0.35.tar.gz#cdgd-2.0.35#./configure–prefix=/usr/local/gd–with-jpeg=/usr/local/jpeg–with-freetype=/usr/local/freetype–with-png–with-zlib//编译过程中会看到如下信息**Configurationsummaryforgd2.0.33:SupportforPNGlibrary:yesSupportforJPEGlibrary:yesSupportforFreetype2.xlibrary:yesSupportforFontconfiglibrary:noSupportforXpmlibrary:noSupportforpthreads:yes//可以看到png、jpeg、freetype都已经安装上了#make#有时第一次编译时产生错误,执行第二次编译即可过去#makeinstall升级安装libxml2,详细见附录做完以上步骤后,进行以下步骤即可。6.正式安装php#tarzxvfphp-5.2.3.tar.gz#cdphp-5.2.3#./configure–prefix=/usr/local/php5–with-mssql=/usr/local/freetds–with-apxs2=/usr/local/apache2/bin/apxs–with-mysql=/usr/local/mysql–with-gd–with-zlib–with-libpng–with-jpeg=/usr/local/jpeg–with-freetype=/usr/local/freetype–enable-sockets–with-iconv–enable-mbstring–enable-track-vars–enable-force-cgi-redirect–with-config-file-path=/usr/local/php5/etc#make#makeinstall7.整合php和apachecpphp.ini-dist/usr/local/php5/etc/php.inivi/usr/local/php5/etc/php.ini修改MSSQL默认编码:mssql.charset=GBK注意在/usr/local/apache2/conf/httpd.conf加上下代码使apache执行PHPAddTypeapplication/x-httpd-php.php4AddTypeapplication/x-httpd-php3.php3AddTypeapplication/x-httpd-php4.php4AddTypeapplication/x-httpd-php-source.phps8.安装ZendOptimizer#tarzxvfZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz#cdZendOptimizer-3.0.1-linux-glibc21-i386#./install.sh附:软件下载地址:apache2.2.4:::::::,libxml2-devel-2.6.11-1.i386.rpm,libxml2-python-2.6.11-1.i386.rpm升级步骤相见附录:===========================================================类似提示错
本文标题:Linux AS4下PHP_APACHE_MYSQL整合安装过程
链接地址:https://www.777doc.com/doc-3442350 .html