Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
568 views
in Technique[技术] by (71.8m points)

wampserver - WAMP server doesn't work properly on Windows 10

I just upgraded my OS to Windows 10 and I have an atypical problem. I use WAMP server and PHP doesn't work, although no error is displayed anywhere.

I tried to update vcredist or to change ports, but the problem persists.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Windows 10 does not come with all the older MSVC Runtimes installed.

You will also have to install any of these that are missing.

VC2017 (VC15) is backward compatible to VC2015 (VC14). That means, a VC14 module can be used inside a VC15 binary. Because this compatibility the version number of the Redistributable is 14.1x.xx and after you install the Redistributable VC2017, VC2015 is removed but you can still use VC14.

UPDATE April 2017

Most of the MSVC runtimes are now available from this microsoft page

Which versions of the above you actually need to run WAMPServer, or rather Aapche, will depend upon the version of WAMPServer you are running, but installing all of them can do no harm as they are used by any software that has been compiled with the Microsoft compilers.

If you are using WAMPServer 64bit on Windows 10 64bit, you will need to install BOTH the 32 and 64bit versions of these libraries.

After you have checked you have all the runtime libraries, you may also need to re-install the Apache and MYSQL services as the upgrade to Windows 10 unfortunately sometimes (pretty much always) misses the fact that you have 2 services running that should be replaced after the upgrade i.e. wampapache and wampmysqld

All you need to do is, using the wampmanager menus system do this :

left click wampmanager -> Apache -> Services -> Install Service

left click wampmanager -> MySQL -> Services -> Install Service

Then

left click wampmanager -> Start All Services

Additional info

Also remember that for PHP to be interpreted, the code must exist in a file with a .php extension. If you are using notepad as an editor, that will add a .txt to a filename, so if you save tst.php it will actually get saved as tst.php.txt and therefore will not run. Get a decent editor notepad++ will do a great job and is free.

Also files with the .html or .htm that contain php code will not execute the php code as these files are not passed to the PHP interpreter, because they dont have the .php extension.

Using Explorer

Dont double click on the script file name in Windows Explorer. This works to test pure HTML pages, or HTML + Javascript pages, but it does not work if the page has PHP code in it However doing this does not go via Apache, and it is Apache that see's the <?php tags and therefore know to pass this code to the PHP interpreter.

You must enter the script file name into the browser address bar, as if it were a real web site, because of course it is

For example localhost/project1/test.php


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...