浪人 发表于 2015-8-5 09:32:08

linux apache+php+mysql安装及乱码解决办法

  1、乱码解决方法
  首先确认mysql数据库字符集设置正确,php页面字符设置正确,之后修改apache配制文件http.conf 注释掉以下字符
  AddDefaultCharset UTF-8
  此为乱码根源,注释掉此字符#AddDefaultCharset UTF-8
  2、使用rhel6自带apache服务在安装php时会找不倒apxs文件
  需要安装httpd-devel-**.rpm
  安装好以后的apxs文件存放于/usr/sbin/目录下
  3、安装mysql 出理错误how to run mysqld as root
  修改/etc/my.cnf
  在
  
  user=mysql
  4、安装GD库时PNG头文件出错(gd-2.0*.tar.gz)
  解压gd安装文件修改安装文件下的gd_png.c
  在文件的16行把png.h修改为你安装的libpng路径下的include/png.h
  5、安装PHP5时需在安装组件
  zlib
  libpng
  jpeg6
  freetype
  gd2
  libxml2
  curl
  安装GD2时
  ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6 --with-zlib=/usr/local/zlib --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype
  安装PHP时
  ./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs2 --with-mysql-dir=/usr/include/mysql --with-gd-dir=/usr/local/gd2 --with-zlib --with-jpeg-dir=/usr/local/jpeg6 --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/local/freetype --with-xpm --enable-ftp --enable-sockets
  PS:如果谁看到了这篇文章请不作为参考,相信除了我自己其它人很难看懂我写的是什么。
页: [1]
查看完整版本: linux apache+php+mysql安装及乱码解决办法