简体   繁体   English

php -f file.php cats文件到命令行?

[英]php -f file.php cats file to command line?

I've just written a simple php file only containing: 我刚刚编写了一个仅包含以下内容的简单php文件:

echo 'some text';

I now want to execute that from the command line. 我现在想从命令行执行该操作。 When I do php -v , I get: 当我做php -v ,我得到:

HP 5.5.12-1~dotdeb.1 (cli) (built: May  6 2014 03:56:10)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

but when I do php -f file.php , it simply cats the file: 但是当我执行php -f file.php ,它只是为文件提供了php -f file.php

# php -f file.php
echo 'some text';
#

I also tried php file.php , but to no avail. 我也尝试了php file.php ,但无济于事。

Does anybody know what I'm doing wrong here? 有人知道我在做什么错吗? All tips are welcome! 欢迎所有提示!

Juste将开始和结束标记<?php ... ?>到file.php中,它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM