您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 公司方案 > php环境搭建手册参考
环境搭建手册(PHP版)软件版本:RedHatEnterpriseLinux5Update2Apache版本:2.29Mysql版本:5.1.26PHP版本:5.26PHP依赖名称及版本:(1)libiconv1.12(2)freetype2.37(3)libpng1.2.29(4)jpegsrc(5)gd2.0.35(6)libxml22.6.32(7)libmcrypt2.5.8(8)mhash0.99(9)mcrypt2.6.7(似乎非必需)安装步骤一、把所有依赖包,需要安装的软件放到home/username下二、先用rpmqa|grep–i包名查找一下mysql,apache是不是已经装上了,例如mysqlqa|grep–imysqlmysqlqa|grep–ihttpd,如果mysql装上了,用rpm–emysql删除,如果httpd也装上了的话…从新装系统把,清理起来太麻烦了。三、进入放包的目录,开始装吧:32位机器:1.首先安装perl-DBI-1.52-1.fc6.i386.rpm,MySQL-server-community-5.1.26-0.rhel5.i386.rpm依赖此包。rpm-ivhperl-DBI-1.52-1.fc6.i386.rpm2.安装Mysqlrpm-ivhMySQL-server-community-5.1.26-0.rhel5.i386.rpmrpm-ivhMySQL-client-community-5.1.26-0.rhel5.i386.rpmrpm-ivhMySQL-devel-community-5.1.26-0.rhel5.i386.rpm64位机器:1rpm–ivhperl-DBI-1.52-1.fc6.x86_64.rpm2rpm–ivhMySQL-server-community-5.1.26-0.rhel5.x86_64.rpmrpm–ivhMySQL-client-community-5.1.26-0.rhel5.x86_64.rpmrpm–ivhMySQL-devel-community-5.1.26-0.rhel5.x86_64.rpm3.安装Apachetarjxvfhttpd-2.2.9.tar.bz2cdhttpd-2.2.9./configure--prefix=/usr/local/apache2--enable-somakemakeinstall4.安装libiconvtarzxvflibiconv-1.12.tar.gzcdlibiconv-1.12./configure--prefix=/usr/local/libiconvmakemakeinstall5.安装freetypetar-zxvffreetype-2.3.7.tar.gzcdfreetype-2.3.7./configure--prefix=/usr/local/freetype2makemakeinstall6.安装libpngcdlibpng-1.2.29./configure--prefix=/usr/local/libpngmakemakeinstall7.安装jpegsrcmkdir/usr/local/jpeg6mkdir/usr/local/jpeg6/binmkdir/usr/local/jpeg6/libmkdir/usr/local/jpeg6/includemkdir/usr/local/jpeg6/manmkdir/usr/local/jpeg6/man/man1tar-zxvfjpegsrc.v6b.tar.gzcdjpeg-6b/32位机器:./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-staticmakemakeinstall64位机器:cp/usr/share/libtool/config.guessconfig.guesscp/usr/share/libtool/config.subconfig.sub./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-staticmakelibdir=/usr/lib64makelibdir=/usr/lib64install使用64位函数库编译.8.安装gdtarvxfgd-2.0.35.tar.bz2cdgd-2.0.35./configure--prefix=/usr/local/gd--with-png-dir=/usr/local/lib--with-freetype-dir=/usr/local/freetype2--with-jpeg-dir=/usr/local/jpeg6make&&makeinstall或者:makemakeinstall9.安装libxml2tarzxvflibxml2-2.6.32.tar.gzcdlibxml2-2.6.32./configure--prefix=/usr/local/libxml2makemakeinstall(过程比较缓慢,耐心等待)分支110.安装(libmcrypt)tarvxflibmcrypt-2.5.8.tar.bz2cdlibmcrypt-2.5.8./configure--prefix=/usr/local/libmcryptmakemakeinstall11.安装mhashtarxvfmhash-0.9.9.tar.bz2cdmhash-0.9.9/./configure--prefix=/usr/local/mhashmakemakeinstallln-s/usr/local/mhash/lib/libmhash.so.2/usr/lib/libmhash.so.211.安装PHPtarxvfphp-5.2.6.tar.bz2cdphp-5.2.632位机器:./configure--prefix=/usr/local/php5--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql--with-gd--with-jpeg-dir=/usr/local/jpeg6--with-zlib--with-png-dir=/usr/local/lib--with-freetype-dir=/usr/local/freetype2--with-iconv--with-gmp--with-curl--with-mcrypt-dir=/usr/local/libmcrypt--with-pdo-mysql--with-json--with-gettext--with-libxml-dir=/usr/local/libxml2--enable-sockets--enable-ftp--enable-soap--enable-zip--enable-mbstring--with-mhash-dir=/usr/local/mhash64位机器:#mkdir/usr/local/lib/mysql#cd/usr/local/lib/mysql#ln–s/usr/include/mysqlinclude#ln–s/usr/lib64/mysqllib./configure--with-libdir=lib64--prefix=/usr/local/php5--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql--with-gd--with-jpeg-dir=/usr/local/jpeg6--with-zlib--with-png-dir=/usr/local/lib--with-freetype-dir=/usr/local/freetype2--with-iconv--with-gmp--with-curl--with-mcrypt-dir=/usr/local/libmcrypt--with-pdo-mysql-dir=/usr/local/lib/mysql--with-json--with-gettext--with-libxml-dir=/usr/local/libxml2--enable-sockets--enable-ftp--enable-soap--enable-zip--enable-mbstring--with-mhash-dir=/usr/local/mhash--with-config-file-path=/usr/local/php5/etcmakemakeinstall12.修改配置文件cpphp.ini-dist/usr/local/php5/etc/php.inivim/usr/local/apache2/conf/httpd.conf找到DirectoryIndexindex.html改为DirectoryIndexindex.htmlindex.html.varindex.htmindex.php找到AddTypeapplication/x-gzip.gz.tgz加AddTypeapplication/x-httpd-php.php(注意空格)AddTypeapplication/x-httpd-php-source.phps13.重启apache/usr/local/apache2/bin/apachectlrestart14.测试效果如果没有修改路径的话,apache默认页面访问路径是cd/usr/local/apache2/htdocs/之后viminfo.php,写个phpinfo看看效果吧。//**********************注释掉*******************************//分支2(这种做法可能存在问题)10.安装(libmcrypt)tarvxflibmcrypt-2.5.8.tar.bz2./configure--prefix=/usr/local/libmcryptmakemakeinstall/sbin/ldconfigcdlibltdl/./configure--enable-ltdl-installmakemakeinstall12.安装mhashtarzxvfmhash-0.9.9.tar.gzcdmhash-0.9.9/./configure--prefix=/usr/local/mhashmakemakeinstallcp/usr/local/lib/libmcrypt.*/usr/libln-s/usr/local/mhash/libmhash.so.2/usr/lib/libmhash.so.213.安装mcrypttarzxvfmcrypt-2.6.7.tar.gzcdmcrypt-2.6.7/./configure--prefix=/usr/local/mcryptmakemakeinstall//**************************注释掉******************************//在64位机器上安装memcached软件版本:Memcached1.2.6.安装需要支持的包及版本:Libevent1.4.6-stable安装步骤:1.安装libevent#tarzxvflibevent-1.4.6-stable.tar.gz#cdlibevent-1.4.6-stable#./configure–prefix=/usr/local#make#makeinstall查看是否安装成功,进行确认:#ls–al/usr/loca/lib|greplibevent在屏幕上出现如下信息,安装成功:lrwxrwxrwx1rootroot21Aug709:35libevent-1.4.so.2-libevent-1.4.so.2.1.1-rwxr-xr-x1rootr
本文标题:php环境搭建手册参考
链接地址:https://www.777doc.com/doc-905020 .html