简体   繁体   中英

How do I launch a PHP file using command line

Specifically I'm looking at Symphony and I'm running through this page. It suggests that I launch a file using command line.

OS: Windows Visa 32

Any help?

Open a command line, and type

php check_configuration.php

(Press Enter after that).

If you're trying to execute php on Windows, you need to set up your PATH variable to include the php binary directory beforehand.

If you're on a POSIX-compatible system (Linux/Mac OS X) and you're getting a "command not found error message", you need to install php and its CLI interface, often in a package php-cli or similar.

Generally, you should be able to do php -f somefile.php . See the PHP command line manual for more info. The link you gave also shows what to do.

Do exactly what it says on that page:

php server_check.php

Assuming you are in the dir containing servercheck.php.

Most of the other symfony commands actually use a single file you can invoke those with

symfony namespace:task [options] [arguments]

or

php symfony namespace:task [options] [arguments]

When it says to run that file, basically its the same as pasting that file to the directory of symphony's php config files, and then running it in your browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM