Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running php in cmd gives access is denied and "This app can't run on your PC"

I have installed xampp on my windows 8.1 and wanted to add PHP to environmental variables. Therefore, under path i added ;C:\xampp\php; in the end, like i have done some long time ago.

Now, when i try to run any php function in cmd, i get the windows message

"This app can't run on your PC.."

and a "Access is denied" in cmd.

If i remove php from the path variable, i still get the same error.

What i suspect could be a problem is that when trying to add the variable by typing SET PATH=%PATH% I accidentally clicked enter and therefore might have added an some weird value, although i have double checked and the whole line looks fine (no weird leftovers or something).

like image 585
Adam Avatar asked Dec 20 '22 02:12

Adam


1 Answers

I had the same problem, I have tried a lot of things, but without success ... At the end of my efforts, I noticed that the size php.exe is 0KB , so I copy php.exe from my backup folder, where size is php.exe 75kB and php via cmd works

like image 109
smeta Avatar answered Jan 06 '23 14:01

smeta