redhat php mysql扩展_Redhat环境MySQL+Apache+PHP环境配置

红帽不注册,yum方法:

查看yum包

rpm -qa|grep yum

卸载之

rpm -qa|grep yum|xargs rpm -e –nodeps

并且安装之

rpm -ivh yum-*

注意:yum和yum-fastestmirror相互依赖,所以同时安装即可。

下载yum的配置源

wget http://www.linuxidc.com/files/2011/05/06/CentOS-Base.repo 下载到 /etc/yum.repos.d/ 目录下面

运行yum makecache生成缓存

1. MySQL

(1). rpm安装:rpm -ivh MySQL-shared-5.6.11-1.rhel5.x86_64.rpm

rpm卸载:rpm -e MySQL-shared

rpm查看:rpm -aq

a. MySQL-server-5.6.10-1.rhel5.x86_64.rpm

b. MySQL-client-5.6.10-1.rhel5.x86_64.rpm

c. MySQL-devel-5.6.10-1.rhel5.x86_64.rpm

d. MySQL-shared-5.6.11-1.rhel5.x86_64.rpm

(2). cp /usr/share/mysql/my-default.cnf /etc/my.cnf

(3). 如果出现InnoDB的ibdata1错误,根据错误日志,vi /etc/my.cnf

添加innodb_data_file_path = ibdata1:10M:autoextend

2. Apache2安装

./configure --enable-lib64 -libdir=/usr/lib64 --enable-cache --enable-cache-disk --with-pcre=/usr/local --enable-ssl --with-ssl=/usr/ --with-libxml2=/usr --enable-so --enable-expires --enable-rewrite

make;make install

自动启动:

(1). cp apachectl /etc/init.d/apache

(2). vi /etc/init.d/apache

在!/bin/sh后面添加chkconfig识别标志,345为启动级别,10和70为关闭和启动顺序。

#chkconfig: 345 10 70

#description: Start and stop the Apache HTTP Service.

(3). chkconfig --add apache

3. PHP5.4.14安装

(1) tar -xvf php-5.4.14.tar.bz2

(2). ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/ --with-libxml-dir=/usr/ --with-gd=/usr --with-jpeg-dir=/usr/ --with-png-dir=/usr/ --with-png-dir=/usr/ --with-zlib-dir=/usr/lib64/ --with-freetype-dir=/usr/ --with-curl=/usr --enable-soap --with-xsl=/usr --enable-sockets --enable-mbstring --enable-soap

(3). make; make install

(4). cp php.ini-product /usr/local/lib/php.ini

4. 配置Apache2和PHP

(1). vi/usr/local/apache2/conf/httpd.conf 打开配置文件,/AddType找到AddType,添加

AddType application/x-httpd-php .php

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

:wq保存退出(windows也一样添加)

(2). opcode缓存apc

tar -xvf APC-3.1.9.tgz

cd APC-3.1.9

/usr/local/bin/phpize

./configure --enable-apc --with-apc-mmap

make; make install

编辑php.ini

添加配置信息

[apc]

extension=apc.so

apc.cache_by_default=1

apc.enabled=1

apc.shm_segments=1

apc.shm_size=128M

apc.ttl=0

apc.user_ttl=7200

apc.num_files_hint=1000

apc.write_lock=1

apc.stat=0

apc.maxfile_size=1M

(3) mod_cache配置

CacheDefaultExpire  3600

CacheMaxExpire  86400

CacheLastModifiedFactor  0.1

CacheRoot  "D:/Program Files/Apache Software Foundation/Apache2.2/cache/"

CacheEnable disk /

CacheDirLevels 5

CacheDirLength 3

CacheMaxFileSize  10000000

CacheMinFileSize  1

(4) xdebug配置

linux安装

pecl install xdebug

php.ini添加

[Xdebug]

zend_extension="/usr/local/lib/php/extensions/no-debug-zts-20100525/xdebug.so"(linux)

zend_extension="D:\Program Files\PHP\ext\php_xdebug.dll"(windows)

xdebug.profiler_output_dir="D:\Program Files\PHP\xdebug"

xdebug.profiler_enable=On

xdebug.profiler_enable_trigger=1

xdebug.default_enable=On

xdebug.show_exception_trace=On

xdebug.show_local_vars=1

xdebug.max_nesting_level=50

xdebug.var_display_max_depth=6

xdebug.dump_once=On

xdebug.dump_globals=On

xdebug.dump_undefined=On

xdebug.dump.REQUEST=*

xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT

xdebug.trace_output_dir="D:\Program Files\PHP\xdebug"

xdebug.trace_output_dir=/usr/local/apache2/xdebug(linux)

注意linux目录要daemon有执行权限chown daemon /usr/local/apache2/xdebug

查看调试文件

下载WinCacheGrind(windows)\kcachegrind(linux)工具

tar -zxf kcachegrind-0.4.6.tar.gz

cd kcachegrind-0.4.6

由于kcachegrind依赖于kde,所以需要先安装kde相关的库:

yum install kdebase-devel

然后再进行安装,注意configure时要制定qt的路径,否则会报checking for Qt... configure: error: Qt (>= Qt 3.0) (headers and libraries) not found错误:

./configure --prefix=`kde-config --prefix`

make && make install

安装完成后在命令行下运行kcachegrind 即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值