Home > Article > Backend Development > How to run php files using cmd
How to run php files using cmd?
Run PHP in the command line mode in the CMD window, first confirm that PHP is already in the environment variable
Recommended: "PHP Tutorial"
php [-f] "File name"
The above command can run the PHP file in the CMD window
Code example, write a simple PHP file
CD command switches the working directory to the path where the PHP file is saved
php -f "File name" Run the instance
php "File name" Run the instance
The above is the detailed content of How to run php files using cmd. For more information, please follow other related articles on the PHP Chinese website!