简体   繁体   中英

Could not execute php script command line

I am using xampp and windows OS. I am trying to execute simple php script command line but I got an error like "Could not open input file http://test.localhost.com/test.php ". Below is my code for the same.

#!/usr/local/bin/php  
<?php  
$stdin = fopen('php://stdin', 'r');  
while (true) {  
        $input = fgets($stdin, 3);  
        if ($input == 42) {  
                break;  
        } else {  
                echo $input;  
        }  
}  
fclose($stdin);  
exit;

I giving me above error. Can anyone tell me what is the problem?

您要调用CLI脚本,而不是网站。

c:/path/to/php.exe c:/path/to/scrip.php

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