5

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.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
Jarek P
  • 63
  • 1
  • 6

4 Answers4

4

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

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • Still doesnt work. PHP error log: PHP Warning: PHP Startup: in Unknown on line 0 – Jarek P Apr 16 '16 at 21:53
  • Ok, in that case you will have to uninstall WAMPServer. Manually delete the `/wamp/` folder and all subfolders. Then reinstall WAMPServer. Remember to do this as `As Administrator` – RiggsFolly Apr 16 '16 at 22:25
  • Ok now no error but still no php. I tried every popular fixes with no solution. I dont know maybe I can check that using some commands in cmd ? – Jarek P Apr 17 '16 at 14:48
  • Do you see the WAMPServer homepage when you enter `localhost` in the browser? – RiggsFolly Apr 17 '16 at 14:58
  • In that case PHP is working as both of those are written in PHP – RiggsFolly Apr 17 '16 at 15:34
  • See additional info, does any of that explain your problems – RiggsFolly Apr 17 '16 at 15:38
  • But for example file:///C:/wamp64/www/index.php its just a text php isnt working there – Jarek P Apr 17 '16 at 15:51
  • See additional info called **Using Explorer** – RiggsFolly Apr 17 '16 at 15:57
  • Ok thank you 2 last questions. In localhost is the title "Your projects" why when I click on my project is redirects me to /myproject without localhost at the beginning? Another question is Why localhost/myproject/index.php redicts me to wampserver homepage(localhost)? – Jarek P Apr 17 '16 at 16:13
  • 1) Use Virtual Host http://forum.wampserver.com/read.php?2,127757 2) Dont know, you had better add the code for that script to your question, use the [edit](http://stackoverflow.com/posts/36598500/edit) link – RiggsFolly Apr 17 '16 at 16:17
0

I faced the problem and solved it by installing Microsoft Visual C/C++ Redistributable 2010 (VC10), both 32bit / 64bit as 2008 and 2012 were already installed. My configuration: windows 10 64 bit, wampserver 64 bit.

Raihan Ruhin
  • 31
  • 1
  • 6
0

One of the problem could be Skype running at the time you want to start your server, so you can

  1. Stop SKYPE because SKYPE utilize port 80 and server wants to use same port.

  2. Go to httpd.conf file and change the Port number from 80 to 8000/8080. -Left click Apache icon, -Go to Apache and open httpd.conf file, -Search and replace port 80 to 8000 / 8080 -Save & close, -Restart the server again.

André
  • 4,417
  • 4
  • 29
  • 56
MwarukaSon
  • 297
  • 4
  • 9
0

Update: Wamp working with Windows 10 in 2020

enter image description here

You can try this, I done the following things.

  1. Install msvcp140.dll
  2. Install Microsoft Visual C/C++ Redistributable
  3. Install wamp server
  4. Close Skype (Chat App) if it is running

But wamp icon did not change its color to orange to green. (turning wamp icon orange to green means it start working). I installed wamp multiple time to make it color orange to green but it still show orange color. But actually, behind the scene it was working I checked it in browser by URL: http://localhost/phpmyadmin/

Billu
  • 2,733
  • 26
  • 47