xampp常见问题处理

XAMPP只支持32位的linux。所以如果在64位中运行XAMPP会报错:XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system.

解决这个问题很简单,只需安装32位库,运行:

  1. yum install -y glibc*i686
  2. sudo apt-get install ia32-libs

 

安装完之后要考虑以下安全问题,XAMPP为了方便开发,被设置得尽量开放,但这也带来一些安全问题。这儿有一份 XAMPP 缺乏安全防护的列表:

  • MySQL 管理员(root)没有密码。
  • MySQL 可通过网络访问。
  • ProFTPD 使用“lampp”作为用户名“nobody”的密码。
  • PhpMyAdmin 可以通过网络访问。
  • 示例程序可以通过网络访问。
  • MySQL 和 Apache 在同一个用户名(nobody)下运行。
要修正绝大部分的安全薄弱环节,只需执行以下命令:
  1. /opt/lampp/lampp security

接下来可能会遇到phpmyadmin拒绝访问的问题。只需打开httpd-xampp.conf文件,找到<Directory "/opt/lampp/phpmyadmin">,在对应的</Directory>之前加上Require all granted。修改完如下所示:

  1. <Directory"/opt/lampp/phpmyadmin">
  2. AllowOverride AuthConfig Limit
  3. Order allow,deny
  4. Allow from all
  5. Require all granted
  6. </Directory>

然后用 /opt/lampp/lampp restart 重新运行即可正确访问

如果一切顺利那么恭喜恭喜。但是我很不幸的发现进了phpmyadmin却各种没有权限!这个问题在windows下面遇到过,原因应该是在前面解决安全问题时修改了数据库账号root的密码,而phpmyadmin中默认的为空。这么想问题就简单了,到/opt/lampp/phpmyadmin下找到config.inc.php,在/* Authentication type and info */下面加上必要的信息,比如我的就是这样:

  1. /* Authentication type and info */
  2. $cfg['Servers'][$i]['auth_type']='config';
  3. $cfg['Servers'][$i]['host']='localhost';
  4. $cfg['Servers'][$i]['connect_type']='tcp';
  5. $cfg['Servers'][$i]['compress']=false;
  6. $cfg['Servers'][$i]['user']='root';
  7. $cfg['Servers'][$i]['password']='123456';
  8. $cfg['Servers'][$i]['extension']='mysql';
  9. $cfg['Servers'][$i]['AllowNoPassword']=true;

最后重启lampp,linux的世界多么美好~

猜你喜欢

转载自qdjinxin.iteye.com/blog/1797437