我正在尝试学习如何从命令行 (CLI) 访问 PHP 脚本
I am trying to learn how to access PHP scripts from the command line (CLI)
下面是我尝试的图片,请帮忙.我运行的是 Windows 7
Below is an image from my attempt, please help. I am running Windows 7
您需要将您的 PHP 安装目录添加到 %PATH% 环境变量中,或者在 PHP 安装目录下工作.
You need to add your PHP installation directory to the %PATH% environment variable, or work from the PHP installation directory.
将其添加到路径(最佳方法 - 为 Windows 7 编辑):
To add it to path (The best approach - Edited for Windows 7):
我的电脑图标属性Advanced system settingsAdvanced标签环境变量按钮System Variables部分,选择Path(不区分大小写)并点击Edit按钮;),然后添加 PHP 安装的完整文件系统路径(例如 C:Program FilesPHP代码>)OK等直到所有对话框消失My Computer iconPropertiesAdvanced system settings from the left navAdvanced tabEnvironment Variables buttonSystem Variables section, select Path (case-insensitive) and click Edit button;) to the end of the string, then add the full file system path of your PHP installation (e.g. C:Program FilesPHP)OK etc until all dialog boxes have disappeared或者,您可以在尝试运行命令之前运行 cd ,或者像
Alternatively, you can run cd <PHP installation path> before you try and run you command, or call your script like <FULL file system path of php.exe> <path to script>
这篇关于如何在 Windows 上使用命令行访问 PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
PHP、MySQL PDOException 的死锁异常代码?Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死锁异常代码?)
PHP PDO MySQL 可滚动游标不起作用PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滚动游标不起作用)
PHP PDO ODBC 连接PHP PDO ODBC connection(PHP PDO ODBC 连接)
使用 PDO::FETCH_CLASS 和魔术方法Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔术方法)
php pdo 只从 mysql 获取一个值;等于变量的值php pdo get only one value from mysql; value that equals to variable(php pdo 只从 mysql 获取一个值;等于变量的值)
MSSQL PDO 找不到驱动程序MSSQL PDO could not find driver(MSSQL PDO 找不到驱动程序)