php 如何在不重新安装的情况下修复 wamp 服务器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23213915/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to repair wamp server without re-installing?
提问by RiggsFolly
After making changes in php.ini by uncommenting
通过取消注释在 php.ini 中进行更改后
extension=php_openssl.dll
My Windows-8 system got shutdown due to power failure and later i use to get this error when i try to start wamp server
我的 Windows-8 系统因电源故障而关闭,后来我尝试启动 wamp 服务器时遇到此错误
Later visiting some link i added the below code to wampmanager.ini file as it was empty
后来访问了一些链接,我将以下代码添加到 wampmanager.ini 文件中,因为它是空的
Now the first error got fixed and now throwing this error mentioned below:
现在第一个错误得到修复,现在抛出下面提到的这个错误:
Later i also installed visual c++ 2008 to fix this error but unsuccessful. I have many important databases which i have not taken back up also. I am trying to repair this wamp server without re-installing. Can anybody please assist me with this.
后来我还安装了visual c++ 2008来修复这个错误,但没有成功。我有许多重要的数据库,我也没有备份。我正在尝试在不重新安装的情况下修复此 wamp 服务器。任何人都可以帮我解决这个问题。
Thanks in Advance
提前致谢
回答by grigson
go to the wamp/scripts folder
open console
run:php refresh.php
转到 wamp/scripts 文件夹
打开控制台
运行:php refresh.php
this should recreate wampmanager.ini
这应该重新创建 wampmanager.ini
(requires wampmanager.tpl file in wamp folder.
taken from http://sourceforge.net/p/wampserver/feature-requests/10/#750b)
(需要 wamp 文件夹中的 wampmanager.tpl 文件。
取自http://sourceforge.net/p/wampserver/feature-requests/10/#750b)
回答by RiggsFolly
This document may help you How to uninstall WAMPServer without actually uninstalling it
本文档可以帮助您如何在不实际卸载的情况下卸载 WAMPServer
The idea is that you uninstall your current version without actually running the unninstall and without actually deleting any files from your existing install.
这个想法是您卸载当前版本而不实际运行卸载程序并且不实际删除现有安装中的任何文件。
You then rename the current wamp folder and then install the same version of wamp, make sure it works, and then copy all your sites and databases to the new installed wamp. If you install exactly the version of WAMP you have currently then you can copy the whole of the .../mysqlx.y.z/data folder and all you databases and users should be there on the new install.
然后重命名当前的 wamp 文件夹,然后安装相同版本的 wamp,确保它可以工作,然后将所有站点和数据库复制到新安装的 wamp。如果您完全安装当前拥有的 WAMP 版本,那么您可以复制整个 .../mysqlx.yz/data 文件夹,并且所有数据库和用户都应该在新安装中。
This gets over whatever damage was done to your existing install. You may need to edit the php.ini and httpd.conf to match your existing configuration. I suggest you do not do a straight copy of either of these files as that may just get you to where you are now.
这可以克服对现有安装造成的任何损害。您可能需要编辑 php.ini 和 httpd.conf 以匹配您现有的配置。我建议您不要直接复制这些文件中的任何一个,因为这可能会让您到达现在的位置。
回答by RiggsFolly
Fixed by installing wamp again into the same directory by renaming the older wamp. I just replaced wampmanager.ini file of new to the old one. Earlier it was just a little piece of code i pasted in wampmanager.ini file. But now it is a big one which fixed this issue. Thanks a lot for you guys, your suggestions saved my time. I did not change anything with php.ini also.
通过重命名旧的 wamp 将 wamp 再次安装到同一目录中。我只是将新的 wampmanager.ini 文件替换为旧的。早些时候,它只是我粘贴在 wampmanager.ini 文件中的一小段代码。但现在它解决了这个问题。非常感谢你们,你们的建议节省了我的时间。我也没有用 php.ini 改变任何东西。
回答by dlopezgonzalez
I have had the same issue. I am working with WAMP 2.5 version. The content of "wampmanager.ini" is OK but it's possible that the php path is wrong. Check folders of section [StartupAction], in my case my php version is "php5.5.12". Surely the error message "The directory name is invalid" was for this.
我有同样的问题。我正在使用 WAMP 2.5 版本。“wampmanager.ini”的内容没问题,但有可能是php路径不对。检查 [StartupAction] 部分的文件夹,在我的情况下,我的 php 版本是“php5.5.12”。当然,错误消息“目录名称无效”就是为此。
回答by Waruna Manjula
- Backup all YOUR databases in SQL format and store the backups somewhere safe.
- Stop All Services.
- Remove the Apache Service.
- Remove the MySQL Service.
- Exit WAMPServer.
- Rename your current \wamp folder to \wamp_old (This is your backup. DONT FORGET THIS STEP)
- 以 SQL 格式备份所有数据库并将备份存储在安全的地方。
- 停止所有服务。
- 删除 Apache 服务。
- 删除 MySQL 服务。
- 退出 WAMPServer。
- 将您当前的 \wamp 文件夹重命名为 \wamp_old(这是您的备份。不要忘记这一步)
To all intents and purpose, you have uninstalled WAMPServer now. 7. Download and Install the new WAMPServer version (32bit is recommended, 64bit is only for geeks and 64bit PHP is not yet fully converted to 64bit)
出于所有意图和目的,您现在已经卸载了 WAMPServer。7、下载安装新的WAMPServer版本(推荐32bit,64bit仅供极客使用,64bit PHP尚未完全转换为64bit)
- Change NOTHING! Check it works in its out of the box state.
- 什么都不改变!检查它是否在开箱即用状态下工作。
Clear your browser cache ( CTRL+F5 ) to avoid any funnies with cached content. Run localhost Run phpMyAdmin (If asked for a Username and password; username = root / password = (nothing, leave this blank) Run \wamp\www\testmysql.php. you will need to edit the file and change the "mysql_connect('127.0.0.1', 'root', '')"
清除浏览器缓存 ( CTRL+F5 ) 以避免与缓存内容有关的任何有趣内容。运行 localhost 运行 phpMyAdmin(如果要求输入用户名和密码;用户名 = root / 密码 =(没有,留空)运行 \wamp\www\testmysql.php。您需要编辑文件并更改“mysql_connect(' 127.0.0.1'、'根'、'')"
- If you want to bring some/all of your old versions of Apache/PHP/MySQL into the new WAMPServer (Remember, one of the big advantages in WAMPServer is the ability to switch between versions of Apache/PHP and MySQL)
- 如果您想将部分/全部旧版本的 Apache/PHP/MySQL 带入新的 WAMPServer(请记住,WAMPServer 的一大优势是能够在 Apache/PHP 和 MySQL 版本之间切换)
Apache: copy \wamp_old\bin\apache\apachex.y.z folder to \wamp\bin\apache\apachex.y.z
Apache:将\wamp_old\bin\apache\apachex.yz 文件夹复制到\wamp\bin\apache\apachex.yz
PHP: copy \wamp_old\bin\php\phpx.y.z folder to \wamp\bin\php\phpx.y.z
PHP:将\wamp_old\bin\php\phpx.yz 文件夹复制到\wamp\bin\php\phpx.yz
MYSQL: copy \wamp_old\bin\mysql\mysqlx.y.z folder to \wamp\bin\mysql\mysqlx.y.z
MYSQL:将\wamp_old\bin\mysql\mysqlx.yz 文件夹复制到\wamp\bin\mysql\mysqlx.yz
To tell WAMPServer about the old version of Apache/PHP/MySQL you just copied across run a "refresh", right click the wampmanager icon -> Refresh Give it a few seconds to go find all the new versions.
Compare your old configs with the new configs, move over any of your local change/requirements. Remember, config parameters change between versions of Apache/PHP/MySQL ! Make sure your old changes are still required, valid, legal. ( Check the upgrade notes provided by all 3 software providers )
If it all goes horribly wrong. Check the bottom of this Doc to see how to unwind all these changes easily if you get problems.
要告诉 WAMPServer 您刚刚复制的旧版本 Apache/PHP/MySQL,请运行“刷新”,右键单击 wampmanager 图标 -> 刷新 给它几秒钟以查找所有新版本。
将旧配置与新配置进行比较,移过任何本地更改/要求。请记住,配置参数在 Apache/PHP/MySQL 版本之间会发生变化!确保您的旧更改仍然是必需的、有效的、合法的。(查看所有 3 个软件提供商提供的升级说明)
如果这一切都发生了可怕的错误。如果遇到问题,请查看此文档的底部,了解如何轻松解除所有这些更改。
回答by Lee Jones
In win10 you can just right click on the wampmanager.ini file in the root and select Restore Previous Version, then just choose one from a few days ago when it worked.
在win10下你可以在根目录下右键wampmanager.ini文件,选择Restore Previous Version,然后就可以从几天前运行的时候选择一个。
回答by Star
i have similair issue in the morning and searched SO and other forums but none of the solution worked for me.
我早上有类似的问题,并搜索了 SO 和其他论坛,但没有一个解决方案对我有用。
It was
它是
syntax error on line number 561 (due to MariaDB)
第 561 行的语法错误(由于 MariaDB)
After checking all wamp installation for MariaDB, i find out that file at root: wampmanager.conf
contain lines about MariaDB. I removed all of those and then restarted wamp. It worked like charm!
在检查了 MariaDB 的所有 wamp 安装后,我在根目录中找到了该文件:wampmanager.conf
包含有关 MariaDB 的行。我删除了所有这些,然后重新启动 wamp。它像魅力一样工作!