php环境搭建手册参考.doc_第1页
php环境搭建手册参考.doc_第2页
php环境搭建手册参考.doc_第3页
php环境搭建手册参考.doc_第4页
php环境搭建手册参考.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

环境搭建手册(PHP版)软件版本:Red Hat Enterprise Linux 5 Update 2Apache版本:2.29Mysql 版本:5.1.26PHP版本:5.26PHP依赖名称及版本:(1) libiconv 1.12(2) freetype 2.37(3) libpng 1.2.29(4) jpegsrc(5) gd 2.0.35(6) libxml2 2.6.32(7) libmcrypt 2.5.8(8) mhash 0.99(9) mcrypt 2.6.7(似乎非必需)安装步骤一、 把所有依赖包,需要安装的软件放到home/username下二、 先用rpm qa|grep i 包名查找一下mysql, apache是不是已经装上了,例如 mysql qa|grep i mysql mysql qa|grep i httpd,如果mysql装上了,用rpm e mysql 删除,如果httpd也装上了的话从新装系统把,清理起来太麻烦了。三、 进入放包的目录,开始装吧:32位机器:1. 首先安装perl-DBI-1.52-1.fc6.i386.rpm,MySQL-server-community-5.1.26-0.rhel5. i386.rpm依赖此包。rpm -ivh perl-DBI-1.52-1.fc6.i386.rpm2. 安装Mysqlrpm -ivh MySQL-server-community-5.1.26-0.rhel5.i386.rpm rpm -ivh MySQL-client-community-5.1.26-0.rhel5.i386.rpm rpm -ivh MySQL-devel-community-5.1.26-0.rhel5.i386.rpm 64位机器: 1 rpm ivh perl-DBI-1.52-1.fc6.x86_64.rpm 2 rpm ivh MySQL-server-community-5.1.26-0.rhel5.x86_64.rpm rpm ivh MySQL-client-community-5.1.26-0.rhel5.x86_64.rpm rpm ivh MySQL-devel-community-5.1.26-0.rhel5.x86_64.rpm3. 安装Apache tar jxvf httpd-2.2.9.tar.bz2 cd httpd-2.2.9 ./configure -prefix=/usr/local/apache2 -enable-so make make install4. 安装libiconv tar zxvf libiconv-1.12.tar.gz cd libiconv-1.12 ./configure -prefix=/usr/local/libiconv make make install5. 安装freetype tar -zxvf freetype-2.3.7.tar.gz cd freetype-2.3.7 ./configure -prefix=/usr/local/freetype2 make make install6. 安装libpng cd libpng-1.2.29 ./configure -prefix=/usr/local/libpng make make install7. 安装 jpegsrc mkdir /usr/local/jpeg6 mkdir /usr/local/jpeg6/bin mkdir /usr/local/jpeg6/lib mkdir /usr/local/jpeg6/include mkdir /usr/local/jpeg6/man mkdir /usr/local/jpeg6/man/man1 tar -zxvf jpegsrc.v6b.tar.gz cd jpeg-6b/32位机器: ./configure -prefix=/usr/local/jpeg6/ -enable-shared -enable-static make make install64位机器:cp /usr/share/libtool/config.guess config.guesscp /usr/share/libtool/config.sub config.sub ./configure -prefix=/usr/local/jpeg6/ -enable-shared -enable-staticmake libdir=/usr/lib64 make libdir=/usr/lib64 install 使用64位函数库编译.8. 安装gd tar vxf gd-2.0.35.tar.bz2 cd gd-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/jpeg6 make & make install 或者:make make install9. 安装libxml2 tar zxvf libxml2-2.6.32.tar.gz cd libxml2-2.6.32 ./configure -prefix=/usr/local/libxml2 make make install (过程比较缓慢,耐心等待)分支110. 安装(libmcrypt) tar vxf libmcrypt-2.5.8.tar.bz2 cd libmcrypt-2.5.8 ./configure -prefix=/usr/local/libmcrypt make make install11. 安装mhash tar xvf mhash-0.9.9.tar.bz2cd mhash-0.9.9/./configure -prefix=/usr/local/mhashmakemake installln -s /usr/local/mhash/lib/libmhash.so.2 /usr/lib/libmhash.so.211. 安装PHP tar xvf php-5.2.6.tar.bz2 cd php-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/mysql include# ln s /usr/lib64/mysql lib./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/etcmakemake install12. 修改配置文件cp php.ini-dist /usr/local/php5/etc/php.inivim /usr/local/apache2/conf/httpd.conf找到DirectoryIndex index.html改为DirectoryIndex index.html index.html.var index.htm index.php找到AddType application/x-gzip .gz .tgz加 AddType application/x-httpd-php .php (注意空格)AddType application/x-httpd-php-source .phps13. 重启apache/usr/local/apache2/bin/apachectl restart 14. 测试效果如果没有修改路径的话,apache默认页面访问路径是cd /usr/local/apache2/htdocs/之后vim info.php,写个phpinfo看看效果吧。 /*注释掉*/ 分支2 (这种做法可能存在问题)10 安装(libmcrypt) tar vxf libmcrypt-2.5.8.tar.bz2 ./configure -prefix=/usr/local/libmcrypt make make install/sbin/ldconfigcd libltdl/./configure -enable-ltdl-installmakemake install12. 安装mhash tar zxvf mhash-0.9.9.tar.gzcd mhash-0.9.9/./configure -prefix=/usr/local/mhashmakemake installcp /usr/local/lib/libmcrypt.* /usr/libln -s /usr/local/mhash/libmhash.so.2 /usr/lib/libmhash.so.213. 安装mcrypttar zxvf mcrypt-2.6.7.tar.gzcd mcrypt-2.6.7/./configure -prefix=/usr/local/mcryptmakemake install/*注释掉*/在64位机器上安装memcached 软件版本:Memcached 1.2.6. 安装需要支持的包及版本:Libevent 1.4.6-stable安装步骤:1. 安装libevent# tar zxvf libevent-1.4.6-stable.tar.gz# cd libevent-1.4.6-stable# ./configure prefix=/usr/local# make # make install查看是否安装成功,进行确认:# ls al /usr/loca/lib | grep libevent在屏幕上出现如下信息,安装成功:lrwxrwxrwx 1 root root 21 Aug 7 09:35 libevent-1.4.so.2 - libevent-1.4.so.2.1.1-rwxr-xr-x 1 root root 384481 Aug 7 09:35 libevent-1.4.so.2.1.1-rw-r-r- 1 root root 621578 Aug 7 09:35 libevent.alrwxrwxrwx 1 root root 26 Aug 7 09:35 libevent_core-1.4.so.2 - libevent_core-1.4.so.2.1.1-rwxr-xr-x 1 root root 135308 Aug 7 09:35 libevent_core-1.4.so.2.1.1-rw-r-r- 1 root root 229844 Aug 7 09:35 libevent_core.a-rwxr-xr-x 1 root root 866 Aug 7 09:35 libevent_core.lalrwxrwxrwx 1 root root 26 Aug 7 09:35 libevent_core.so - libevent_core-1.4.so.2.1.1lrwxrwxrwx 1 root root 27 Aug 7 09:35 libevent_extra-1.4.so.2 - libevent_extra-1.4.so.2.1.1-rwxr-xr-x 1 root root 306301 Aug 7 09:35 libevent_extra-1.4.so.2.1.1-rw-r-r- 1 root root 484342 Aug 7 09:35 libevent_extra.a-rwxr-xr-x 1 root root 873 Aug 7 09:35 libevent_extra.lalrwxrwxrwx 1 root root 27 Aug 7 09:35 libevent_extra.so - libevent_extra-1.4.so.2.1.1-rwxr-xr-x 1 root root 831 Aug 7 09:35 libevent.lalrwxrwxrwx 1 root root 21 Aug 7 09:35 libevent.so - libevent-1.4.so.2.1.12. 安装memcached# tar zxvf memcached-1.2.6.tar.gz# cd memcached-1.2.6# ./configure with-libevent=/usr/local# make # make install查看是否安装成功# ls al /usr/local/bin/mem*出现如下信息:-rwxr-xr-x 1 root root 155077 Aug 7 09:41 /usr/local/bin/memcached-rwxr-xr-x 1 root root 162760 Aug 7 09:41 /usr/local/bin/memcached-debug安装完成后,查看一下memcahce的help# /usr/local/bin/memcached h出现如下错误:memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory注意: 下面是修复过程# LD_DEBUG=lib memcached v 查看memcached的libs的路径屏幕显示如下信息:7627: find library= libevent-1.4.so.2 0; searching 7627: search cache=/etc/ld.so.cache 7627: search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64 (system search path) 7627: trying file=/lib64/tls/x86_64/ libevent-1.4.so.2 7627: trying file=/lib64/tls/ libevent-1.4.so.2 7627: trying file=/lib64/x86_64/ libevent-1.4.so.2 7627: trying file=/lib64/ libevent-1.4.so.2 7627: trying file=/usr/lib64/tls/x86_64/ libevent-1.4.so.2 7627: trying file=/usr/lib64/tls/ libevent-1.4.so.2 7627: trying file=/usr/lib64/x86_64/ libevent-1.4.so.2 7627: trying file=/usr/lib64/ libevent-1.4.so.2 7627: memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory我们要做的就是记录下最后一行信息, trying file=/usr/lib64/ libevent-1.4.so.2然后我们利用这个来做个符号链接:# ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2下面继续使用/usr/local/bin/memcached h 做测试,成功显示:memcached 1.2.6-p TCP port number to listen on (default: 11211)-U UDP port number to listen on (default: 0, off)-s unix socket path to listen on (disables network support)-a access mask for unix socket, in octal (default 0700)-l interface to listen on, default is INDRR_ANY-d run as a daemon-r maximize core file limit-u assume identity of (only when run as root)-m max memory to use for items in megabytes, default is 64 MB-M return error on memory exhausted (rather than removing items)-c max simultaneous connections,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论