我最近安装了 Zend Server CE,但我无法让 php-win 做任何事情。当我使用标准 php 调用运行 cmd 脚本时,它可以完美运行,但是使用 php-win 的任何调用都无法执行任何操作。无输出;没有什么。
例如:
php C:\path\to\script
以上工作。
但下面没有做任何事情:
php-win c:\path\to\script
有任何想法吗?
我最近安装了 Zend Server CE,但我无法让 php-win 做任何事情。当我使用标准 php 调用运行 cmd 脚本时,它可以完美运行,但是使用 php-win 的任何调用都无法执行任何操作。无输出;没有什么。
例如:
php C:\path\to\script
以上工作。
但下面没有做任何事情:
php-win c:\path\to\script
有任何想法吗?
Quoting from the PHP manual:
As of PHP 5, a new php-win.exe file is distributed. This is equal to the CLI version, except that php-win doesn't output anything and thus provides no console (no "dos box" appears on the screen). This behavior is similar to php-gtk. You should configure with --enable-cli-win32.
I.e. php-win is not supposed to produce output. It can do other things though - write to the disk, to the database, etc. So if you want to check it, write script like:
<?php
file_put_contents("a", "aaa");
and see if the file appears.