Wamp和Xampp在同一台机器上 [英] Wamp and xampp on same machine

查看:100
本文介绍了Wamp和Xampp在同一台机器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直使用wamp2.2,但是我必须安装xamp1.6.8,因为我必须使用为旧php版本创建的项目.Xamp安装可以正常运行,但是当我运行它时,我无法获得本地主机站点.香港专业教育学院得到了空白页面的沼泽图标,并沟通该网站不可用.我知道这是配置案例.有人知道如何解决这个问题吗?

I use wamp2.2 for all the time, but i had to install xamp1.6.8 cause i've got to work with project created for old php version. Xamp installation goes fine but when i run it i cant get localhost site. Ive got blank page with favicon of wamp and comunicate that site is unavaible. I know that this is configuration case. Anybody know how to fix this?

我想一次只运行其中的一个,并且我已经为wamp配置了一些虚拟主机,当xamp运行时,它们不必是可访问的,我只需要为一个项目使用xamp.

I want to run only one of them at once, and i have configured some virtualhosts for wamp they dont have to be accesible while xamp is running i need xamp only for one project.

推荐答案

在同一台计算机上运行xampp和wamp,您可以从arasjoomla网站使用此教程:

for run xampp and wamp in same computer you can use this tutorial from arasjoomla website: http://arasjoomla.ir/joomla-tutorial/how-to-run-xampp-and-wamp-on-same-computer for example we used wamp with default port and setting and set changed in xampp:

  1. 将xampp apache端口80从 httpd.conf 中的示例更改为8080目录 C:\ xampp \ apache \ conf
  2. my.ini 中将 C:\ xampp \ mysql \ bin port = 3306 更改为 port = 3307
  3. config.inc.php 中,位于 C:\ xampp \ phpMyAdmin 中,位于此代码之后:

  1. Change xampp apache port 80 to example 8080 in httpd.conf from directory C:\xampp\apache\conf
  2. In my.ini from C:\xampp\mysql\bin change port=3306 to port=3307
  3. In config.inc.php from C:\xampp\phpMyAdmin after this code:

$ cfg ['Servers'] [$ i] ['AllowNoPassword'] = true;

添加此代码:

$ cfg ['Servers'] [$ i] ['port'] ='3307';

现在重新启动xampp,我们使用xampp和wamp作为示例连接数据库的xampp 端口3307 中的代码:

restart xampp now we cab use xampp and wamp for example use this code in xampp port 3307 for connection database:

$servername = "localhost";
$username = "root";
$password = "";
$dbname = "my_db";
$port = '3307';

$conn = mysqli_connect($servername, $username, $password, $dbname,$port);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}

$sql = "SELECT id, name FROM users";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
   while($row = mysqli_fetch_assoc($result)) {
    echo "id: " . $row["id"]. " - Name: " . $row["name"]. "<br>";
   }
 } else 
     echo "0 results";

mysqli_close($conn);

这篇关于Wamp和Xampp在同一台机器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆