命令行php显示代码而不是执行代码 [英] command-line php displays code instead of executing code

查看:71
本文介绍了命令行php显示代码而不是执行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CLI PHP运行PHP脚本,c:\ wamp \ php \ php.com,但是

而不是执行我的脚本,它实际上显示的是原始代码

代替。


如何使用CLI PHP运行我的代码?我在WinXP上安装了WAMP5。

Thanx

Phil

解决方案

comp .lang.php写道:


我使用CLI PHP运行PHP脚本,c:\ wamp \ php \ php.exe,但是

而不是执行我的脚本,它实际上显示的是原始代码




如何使用我的代码运行CLI PHP?我在WinXP上安装了WAMP5。


Thanx

Phil



php example.php


你的代码必须用<?php和?>包围,就像在网页中一样。


-

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================





1月28日下午1:58,Jerry Stuckle< jstuck ... @ attglobal.netwrote:


comp.lang.php写道:


我使用CLI PHP运行PHP脚本,c:\ wamp \ php\php.exe,但是

而不是执行我的脚本,它实际上显示的是原始代码



如何使用CLI PHP运行我的代码?我在WinXP上安装了WAMP5。


Thanx

Phil



php example.php


>

你的代码必须用<?php和?>包围,就像在网络中一样页。



install.php确实被PHP标签包围,就像在网页

页面中一样。正如我所知,当我做php -q install.php时并查看来源

代码而不是执行。


Phil


> < br $> b $ b -

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司

jstuck ... @ attglobal.net

==================


comp.lang.php写道:
< blockquote class =post_quotes>
>

1月28日下午1:58,Jerry Stuckle< jstuck ... @ attglobal.netwrote:


> comp.lang.php写道:


>>我使用CLI PHP运行PHP脚本,c :\ wamp \ php \ php.exe,但是
而不是执行我的脚本,它实际上是显示原始代码

如何使用我的代码运行CLI PHP?我在WinXP上安装了WAMP5。
Thanx
Phil



php example.php


>您的代码必须用<?php和?>包围,就像在网页中一样。



install.php确实被PHP标签包围,就像在网页

页面中一样。正如我所知,当我做php -q install.php时并查看来源

代码而不是执行。


Phil


> - -
==================
删除x来自我的电子邮件地址
Jerry Stuckle
JDS计算机培训公司
jstuck ... @ attglobal.net
=============== ===



那么它应该可以工作。或者至少它在我使用的每个系统上都有。


但是因为你还没有发布关于你的

安装的脚本或其他任何内容,任何答案都是猜测。


-

==================
删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

I am using CLI PHP to run a PHP script, c:\wamp\php\php.exe, but
instead of executing my script, it''s actually displaying the raw code
instead.

How can I run my code using CLI PHP? I installed WAMP5 on WinXP.
Thanx
Phil

解决方案

comp.lang.php wrote:

I am using CLI PHP to run a PHP script, c:\wamp\php\php.exe, but
instead of executing my script, it''s actually displaying the raw code
instead.

How can I run my code using CLI PHP? I installed WAMP5 on WinXP.
Thanx
Phil

php example.php

Your code must be surrounded with <?php and ?>, just like in a web page.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================




On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:

comp.lang.php wrote:

I am using CLI PHP to run a PHP script, c:\wamp\php\php.exe, but
instead of executing my script, it''s actually displaying the raw code
instead.

How can I run my code using CLI PHP? I installed WAMP5 on WinXP.

Thanx
Phil

php example.php

>
Your code must be surrounded with <?php and ?>, just like in a web page.

install.php is indeed surrounded with PHP tags, just like in a web
page. As I can see when I do "php -q install.php" and see the source
code instead of the executions.

Phil

>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================


comp.lang.php wrote:

>
On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:

>comp.lang.php wrote:

>>I am using CLI PHP to run a PHP script, c:\wamp\php\php.exe, but
instead of executing my script, it''s actually displaying the raw code
instead.
How can I run my code using CLI PHP? I installed WAMP5 on WinXP.
Thanx
Phil


php example.php

>Your code must be surrounded with <?php and ?>, just like in a web page.


install.php is indeed surrounded with PHP tags, just like in a web
page. As I can see when I do "php -q install.php" and see the source
code instead of the executions.

Phil

>--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Then it should work. Or at least it does on every system I''ve used.

But since you haven''t posted the script or anything else about your
installation, any answer is a guess.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


这篇关于命令行php显示代码而不是执行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆