我需要使用一个没有" php“命令的php脚本。
例如:
$ ./test.php
权限设置为755。
这就是脚本
#!/usr/bin/php -q
<?php
echo "hello world";
?>
/usr/bin/php -v (so路径存在)
返回
PHP 7.0.15-1+deb.sury.org~xenial+1 (cli) (built: Jan 20 2017 08:53:13) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-1+deb.sury.org~xenial+1, Copyright (c) 1999-2017, by Zend Technologies
这是我每次都会得到的错误:
Exception: Zend Extension ./test.php does not exist
同样,使用fullpath调用脚本时,我也会得到相同的错误。
这样它就能正常工作
$ php ./test.php
有什么想法吗?
https://stackoverflow.com/questions/42615545
复制相似问题