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.
Windows 10 does not come with all the older MSVC Runtimes installed.
You will also have to install any of these that are missing.
Microsoft Visual C/C++ Redistributable 2015 Update 1 (VC14) 32bit & 64bit selectable on this page
VC15 Redistribuable (Visual C++ 2017)
Visual C++ Redistributable Packages for Visual Studio 2017 x86
Visual C++ Redistributable Packages for Visual Studio 2017 x64
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.
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
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With