【问题标题】:How to put back the WAMP server Offline? Where is the option?如何使 WAMP 服务器脱机?选项在哪里?
【发布时间】:2023-04-10 06:35:01
【问题描述】:

我安装了 Wamp 3.1.3 64 位。
WAMP中基本上有3种图标颜色红色、橙色和绿色
这些功能我也知道,所以不描述了。
但还有另一个图标是绿底红点和黄线。通过 google-ing,我了解到 指示服务器在线。所以到目前为止一切都很好。 我将我的服务器上线
但问题是现在我怎样才能让服务器重新离线?我找不到任何 PUT OFFLINE 选项。我尝试编辑

httpd.conf

&

vhost-htttpd.conf

通过设置所有文件-

Require Local

但没有任何改变。我还重新启动了整个系统。图标是一样的。
那么我怎样才能让它重新离线呢? 编辑: 我想让它只回到本地,即图标的颜色回到只有绿色服务应该运行并且服务器应该在本地运行

【问题讨论】:

  • 嘿,世界上的某个人!

标签: php apache web wamp


【解决方案1】:

遇到了同样的问题,并在 Roshana 链接的法语论坛帖子之后修复了它。顺便说一句,即使在修复之后,在线/离线功能也不再起作用。您必须使用虚拟主机将您的本地站点“在线”。

在文本编辑器中打开 C:/wamp64/scripts/refresh.php 并替换以下内容:

// management of online / offline mode
$c_OnOffLine = 'off';
if ($wampConf['status'] == 'online')
{
    $tpl = str_replace('images_off.bmp', 'images_on.bmp',$tpl);
  $tpl = str_replace($w_serverOffline, $w_serverOnline,$tpl);
  $tpl = str_replace('onlineOffline.php on', 'onlineOffline.php off', $tpl);
  $tpl = str_replace($w_putOnline,$w_putOffline,$tpl);
  $c_OnOffLine = 'on';
}
// management of item put online
if($wampConf['MenuItemOnline'] == 'on') {
    $changeServMenu = ';WAMPPUTONLINE
';
    $changeServMenu .= <<< EOF
Type: item; Caption: "${w_putOnline}"; Action: multi; Actions: onlineoffline
EOF;
    $tpl = str_replace(';WAMPPUTONLINE',$changeServMenu,$tpl);

    $changeServMenu = ';WAMPONLINEOFFLINESTART
';
    $changeServMenu .= <<< EOF
[onlineoffline]
Action: run; FileName: "${c_phpExe}"; Parameters: "onlineOffline.php on";WorkingDir: "${c_installDir}/scripts"; Flags: waituntilterminated
Action: run; FileName: "${c_phpCli}"; Parameters: "refresh.php";WorkingDir: "${c_installDir}/scripts"; Flags: waituntilterminated
Action: service; Service: ${c_apacheService}; ServiceAction: restart;
Action: resetservices;
Action: readconfig;
EOF;
    $tpl = str_replace(';WAMPONLINEOFFLINESTART',$changeServMenu,$tpl);
}

作者:

// management of item put online
if($wampConf['MenuItemOnline'] == 'on') {
    $changeServMenu = ';WAMPPUTONLINE
';
    $changeServMenu .= <<< EOF
Type: item; Caption: "${w_putOnline}"; Action: multi; Actions: onlineoffline
EOF;
    $tpl = str_replace(';WAMPPUTONLINE',$changeServMenu,$tpl);

    $changeServMenu = ';WAMPONLINEOFFLINESTART
';
    $changeServMenu .= <<< EOF
[onlineoffline]
Action: run; FileName: "${c_phpExe}"; Parameters: "onlineOffline.php on";WorkingDir: "${c_installDir}/scripts"; Flags: waituntilterminated
Action: run; FileName: "${c_phpCli}"; Parameters: "refresh.php";WorkingDir: "${c_installDir}/scripts"; Flags: waituntilterminated
Action: service; Service: ${c_apacheService}; ServiceAction: restart;
Action: resetservices;
Action: readconfig;
EOF;
    $tpl = str_replace(';WAMPONLINEOFFLINESTART',$changeServMenu,$tpl);

    // management of online / offline mode
    $c_OnOffLine = 'off';
    if ($wampConf['status'] == 'online')
    {
        $tpl = str_replace('images_off.bmp', 'images_on.bmp',$tpl);
        $tpl = str_replace($w_serverOffline, $w_serverOnline,$tpl);
        $tpl = str_replace('onlineOffline.php on', 'onlineOffline.php off', $tpl);
        $tpl = str_replace($w_putOnline,$w_putOffline,$tpl);
        $c_OnOffLine = 'on';
    }

}

【讨论】:

    【解决方案2】:

    我遇到了和你一样的问题,我是这样解决的,分 3 步解决:

    1. 首先,我简单地复制了以下两个文件夹(位于 wamp64 文件夹中):

      \bin\mysql\mysql5.7.21\**data** 
      \**www**
      
    2. 之后,我卸载并重新安装了 WampServer。

    3. 最后复制粘贴之前的 2 个文件夹,将其内容添加到新安装的新文件夹中,仅此而已!

    您也可能对此链接感兴趣(法语): WampServer 3 Online / Offline

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 2016-08-17
      • 2013-10-08
      • 2013-07-04
      • 2011-09-08
      • 2013-10-22
      • 2011-07-27
      • 2021-06-20
      • 1970-01-01
      • 2020-04-14
      相关资源
      最近更新 更多