I recently installed Zend Server CE but I can't get php-win to do anything. When I run a cmd script using the standard php call it works perfectly but any call using php-win just fails to do anything. No output; nothing.
我最近安装了Zend Server CE,但我不能让php-win做任何事情。当我使用标准的php调用运行cmd脚本时,它运行正常,但使用php-win的任何调用都无法执行任何操作。没有输出;没有。
For example:
php C:\path\to\script
The above works.
以上工作。
But the below doesn't do anything:
但是下面没有做任何事情:
php-win c:\path\to\script
Any ideas?
1 个解决方案
#1
Quoting from the PHP manual:
引用PHP手册:
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.
从PHP 5开始,分发了一个新的php-win.exe文件。这与CLI版本相同,只是php-win不输出任何内容,因此不提供控制台(屏幕上不显示“dos box”)。此行为类似于php-gtk。您应该使用--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-win不应该产生输出。它可以做其他事情 - 写入磁盘,数据库等。所以如果你想检查它,写脚本如:
<?php
file_put_contents("a", "aaa");
and see if the file appears.
并查看文件是否出现。
#1
Quoting from the PHP manual:
引用PHP手册:
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.
从PHP 5开始,分发了一个新的php-win.exe文件。这与CLI版本相同,只是php-win不输出任何内容,因此不提供控制台(屏幕上不显示“dos box”)。此行为类似于php-gtk。您应该使用--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-win不应该产生输出。它可以做其他事情 - 写入磁盘,数据库等。所以如果你想检查它,写脚本如:
<?php
file_put_contents("a", "aaa");
and see if the file appears.
并查看文件是否出现。