Xampp安装过程总结(主要针对mysql和phpmyadmin)-很全的了

   折腾了快一天了,终于安装好了。写个总结吧,供后人参考,呵呵。

   CentOS系统中安装了Xampp,安装文件为:xampp-linux-1.7.7.tar.gz,解压后的文件为lampp,正常情况下:执行/opt/lampp/lamppstart 就可以安装好Xampp了,点击phpmyadmin后,就可以使用php了。
   由于已经在CentOS中工作了很久,整个lampp文件中含有自己创建的很多数据库表,php文件等等。
   现在由于工作需要,需换成Fedora虚拟机。如果重新安装Xampp的话,要重新建数据库表或拷入之前创建php文件,比较麻烦。希望可以从CentOS系统中,直接将整个lampp文件拷入Fedora中。

期间遇到好多问题:
1.lampp文件拷出时出现无法拷贝的问题,建议:压缩文件再拷贝。
2.将lampp.tar.gz(CentOS中/lampp的压缩文件)拷入Fedora。
3. 解压后,执行/opt/lampp/lampp start又出现了很多问题,详见下面。


安装Xampp时出现的问题:

1. Apache、MySQL、ProFTPD服务已经运行。

[root@localhost 下载]#/opt/lampp/lampp start
Starting XAMPP for Linux1.7.7...
XAMPP: XAMPP-Apache is alreadyrunning.
XAMPP: XAMPP-MySQL is alreadyrunning.
XAMPP: XAMPP-ProFTPD is alreadyrunning.
XAMPP for Linuxstarted.

解决:分别利用命令:(1)pkill httpd (2)pkill mysql (3)pkill ftp来终止上述三项已开启的服务。


2. 不能启动MySQL服务

[root@localhost opt]# ./lampp/lamppstart
Starting XAMPP for Linux1.7.7...

Deprecated: Directive 'register_globals' isdeprecated in PHP 5.3 and greater in Unknown on line0
XAMPP: Starting Apache with SSL (andPHP5)...
XAMPP: Starting MySQL...
XAMPP: Couldn't start MySQL!
XAMPP: Starting ProFTPD...
XAMPP for Linux started.

解决:(1)chown-hR root /opt/lampp  (2)chmod-R 777 /opt/lampp  (3)/opt/lampp/lampprestart


3.  Warning:World-writable config file '/opt/lampp/etc/my.cnf' isignored

[root@localhost opt]#/opt/lampp/lampp restart
Stopping XAMPP for Linux1.7.7...
XAMPP: XAMPP-Apache is notrunning.
XAMPP: XAMPP-MySQL is notrunning.
XAMPP: StoppingProFTPD...
XAMPP stopped.
Starting XAMPP for Linux1.7.7...

Deprecated: Directive'register_globals' is deprecated in PHP 5.3 and greater in Unknownon line 0
XAMPP: Starting Apache withSSL (and PHP5)...
XAMPP: Starting MySQL...
Warning: World-writable configfile '/opt/lampp/etc/my.cnf' is ignored
XAMPP: StartingProFTPD...
XAMPP for Linux started.

解决:(1)chmod 755 /opt/lampp/etc/my.cnf (2)chmod 755 /opt/lampp/phpmyadmin (3) vi/opt/lampp/etc/php.ini  将“;session.save_path = “/tmp””前面的“;”去掉,即去掉注释语句(个人认为这一步可以省略,如果不行的话,建议大家还是加上这一步) (4) 重启lampp.


4.Permission denied  

[root@localhost lampp]# ./lamppstart
StartingXAMPP for Linux 1.7.4...
/opt/lampp/bin/php: error while loading shared libraries:libz.so.1: cannot enable executable stack as shared objectrequires: Permission denied
XAMPP: Starting Apache with SSL ...
/opt/lampp/bin/httpd: error while loading shared libraries:libexpat.so.0: cannot enable executable stack as shared objectrequires: Permission denied
XAMPP: Error 127! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Sorry, I've no idea what's going wrong.
XAMPP: Please contact our forumhttp://www.apachefriends.org/f/
XAMPP: Starting MySQL...
./bin/my_print_defaults: error while loading shared libraries:libz.so.1: cannot enable executable stack as shared objectrequires: Permission denied
XAMPP: Couldn't start MySQL!
XAMPP: Starting ProFTPD...
XAMPP: /opt/lampp/sbin/proftpd: error while loading sharedlibraries: libcrypto.so.1.0.0: cannot enable executable stack asshared object requires: Permission denied
XAMPP: Error 127! Couln't start ProFTPD!
XAMPP for Linux started.

解决:(1) 终端输入:setsebool-P allow_execstack on   (2)重启lampp 


5、进入phpMyAdmin页面时显示:Wrong permissions on configurationfile, should not be world writable

解决: chomd -R755 /opt/lampp/phpmyadmin


6.进入Xampp的首页,选择语言后页面无法跳转,查看日志(进入目录:/opt/lampp/logs/下,tail -ferr_log),发现错误:
Warning:file_get_contents(lang.tmp) [function.file-get-contents]: failed toopen stream: Permissiondenied in/opt/lampp/htdocs/xampp/index.php on line 2

Warning:Cannot modify header information - headers already sent by (outputstarted at /opt/lampp/htdocs/xampp/index.php:2) in/opt/lampp/htdocs/xampp/index.php on line 4

解决:chmod764 /opt/lampp/htdocs/xampp/lang.tmp

7. Whenyou try to access mysql you would get an error as : “cannot startsession without errors, please check errors given in your PHPand/or webserver log file and configure your PHP installationproperly”

If the above said problem was already solved then you mightencounter the new problem which says,

“Wrong permissions on configuration file,should not be world writable!”.

解决:chmoda-w /opt/lampp/phpmyadmin/config.inc.php


8. 进入phpmyadmin时,出现错误:  #2002 - 服务器没有响应 (或者本地 MySQL服务器的套接字没有正确配置)

   网上查到的解决方法是:

找到phpmyadmin文件夹在xampp/phpmyadmin下(具体视自己安装的路径来查找);找到config.inc.php文件,用notepad等软件打开找到$cfg['Servers'][$i]['host']= 'localhost';这一行,然后将这里的localhost修改为127.0.0.1。

      但是我并未在文件config.inc.php中发现行:$cfg['Servers'][$i]['host']= 'localhost';

      真正的解决方法是:在Xampp的欢迎界面中:您可以通过浏览https://127.0.0.1 或者 https://localhost 来验证OpenSSL点击两个链接,获取证书,添加例外就好。


9.Xampp安装好后,打开phpmyadmin时,发现乱码

解决:

(1)去phpMyAdmin的根目录下,打开以下这个文件: libraries/select_lang.lib.php

找到"$mysql_charset_map = array("那一行,把'gb2312'=> 'gb2312', 改成 'gb2312' => 'latin1',

保存,OK。
(2)进入phpMyAdmin管理,选择语言chinese simplified(zh-gb2312-utf-8) 。
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值