0

I just installed PHP7 on my windows 10 machine from here (the thread safe 64 bit version) http://windows.php.net/download#php-7.0

I manually set the path to the php folder and set up the php.ini. Whenever I want to use the php command it just goes into the next line without doing anything. It doesn't even matter what arguments I type in. There is no error message so I am clueless on what could be the problem.

Here is what happens:

PS C:\Users\Jakob> php
PS C:\Users\Jakob> php cjasdf
PS C:\Users\Jakob>

Even if i navigate into the php folder and execute the php.exe nothing happens as well:

PS C:\php> .\php.exe
PS C:\php> .\php.exe aleass
PS C:\php>
8
  • If you didn't put the path to php's folder into the environment variable PATH then you need to use the full path to php. Commented Jan 26, 2016 at 11:04
  • Try this php -v what does that give you Commented Jan 26, 2016 at 11:12
  • Oh PHP 7 is now at version PHP7.0.2, wont be part of this problem but why start 2 steps back from current Commented Jan 26, 2016 at 11:13
  • php -v doesn't give any output Commented Jan 26, 2016 at 11:14
  • 1
    Also try using a standard Command Window instead of Power Shell Commented Jan 26, 2016 at 11:20

1 Answer 1

1

RE: Your comment about a missing Visual C/C++ runtime library

The first thing you need to do is update Windows with that runtime library Download it from here

Ok Power Shell is A completely different beast to the command prompt and all the usual DOS commands are replaced with PS commands

I got PHP to run in Power Shell like this

Running PHP by switching into the folder where PHP is installed

 PS > Set-Location c:\php
 PS > php -v

And here is how I would do it better, by adding the C:\php folder to the PATH, but only for the duration of the PS Windows instance i.e. not a permanant change to the Windows PATH

Add your PHP folder to the WINDOWS PATH for the duration of this PS execution

PS > $ENV:Path = $ENV:Path + ";c:\php"

The CD (or the PS equivalent) into the folder containing your PHP CLI scripts

PS > Set-Location c:\php-source
PS > php test.php

Thanks, I have never used Power Shell before and finding this simple stuff out made me think I should spend some time learning more about it.

Sign up to request clarification or add additional context in comments.

1 Comment

This may also help if you insist on using PS stackoverflow.com/questions/714877/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.