Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8681977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:38:57+00:00 2026-06-12T21:38:57+00:00

I want to run a .php file in windows cmd. I followed this (suggestion)

  • 0

I want to run a .php file in windows cmd.
I followed this (suggestion)
php is not recognized as an internal command (in Windows)

But it did not work.

I tried this command prompt:
C:\Windows\system32> cd \myfolder

And within myfolder I did as follows:
C:..\myfolder> php file.php
but I get an error “php is not recognized as internal or external”

But when I try without php command like this;
C:..\myfolder> file.php

it just opens in notepad, yet I want to run it in cmd.
How can I do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:38:58+00:00Added an answer on June 12, 2026 at 9:38 pm

    If running Windows 10:

    1. Open the start menu
    2. Type path
    3. Click Edit the system environment variables (usually, it’s the top search result) and continue on step 6 below.

    If on older Windows:

    1. Show Desktop.

    2. Right Click My Computer shortcut in the desktop.

    3. Click Properties.

    4. You should see a section of control Panel – Control Panel\System and Security\System.

    5. Click Advanced System Settings on the Left menu.

    6. Click Enviornment Variables towards the bottom of the System Properties window.

    7. Select PATH in the user variables list.

    8. Append your PHP Path (C:\myfolder\php) to your PATH variable, separated from the already existing string by a semi colon.

    9. Click OK

    10. Open your “cmd”

    11. Type PATH, press enter

    12. Make sure that you see your PHP folder among the list.

    That should work.

    Note: Make sure that your PHP folder has the php.exe. It should have the file type CLI. If you do not have the php.exe, go ahead and check the installation guidelines at – http://www.php.net/manual/en/install.windows.manual.php – and download the installation file from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run a PHP file/function that will not stop until it finishes
I want to run this PHP function -- $querystring_arr='maxResults=50&startIndex=50&sort=date'; $str=preg_replace((&startIndex=)?[0-9]*(&)?,&startIndex=.$sindex.&,$querystring_arr); When I print $str
I want to run a php script from the command line that is always
I have written php program and uploaded on server. I want run this program
In PHP I want to rename (move/copy) a file on a windows file server:
I am writing a pre-commit hook. I want to run php -l against all
I run PHP 5.2 on Ubuntu with Apache 2. When I want to serve
I want to run a particular block of PHP if the user submits a
I have a series of PHP scripts that I want to run in a
I have a series of PHP statements that I only want to run if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.