设为首页 收藏本站
查看: 758|回复: 0

[经验分享] Redhat环境MySQL+Apache+PHP环境配置

[复制链接]
发表于 2018-11-24 11:53:57 | 显示全部楼层 |阅读模式
  红帽不注册,yum方法:
  查看yum包
rpm -qa|grep yum
卸载之
rpm -qa|grep yum|xargs rpm -e –nodeps
  下载对应的yum包,...为机器型号
http://centos.ustc.edu.cn/centos/5/os/.../CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
  http://centos.ustc.edu.cn/centos/5/os/.../CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
  http://centos.ustc.edu.cn/centos/5/.../CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
  并且安装之
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 即可




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-639006-1-1.html 上篇帖子: rpm包搭建apache的shell脚本 下篇帖子: apache 2.4.X使用htpasswd 出现apache authentication failure passwd mismatch错误
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表