473,588 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

command-line php displays code instead of executing code

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

Jan 28 '07 #1
12 9147
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*******@attgl obal.net
=============== ===
Jan 28 '07 #2


On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attg lobal.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...@attgl obal.net
=============== ===
Jan 28 '07 #3
comp.lang.php wrote:
>
On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>comp.lang.ph p 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...@attg lobal.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*******@attgl obal.net
=============== ===
Jan 28 '07 #4


On Jan 28, 2:56 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.php wrote:
On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attg lobal.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...@attgl obal.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.

I tried with a very simple one-liner script:

<?php

print_r("hello world");

?>

And that is exactly what I see instead of "hello world"

Phil
>
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Jan 28 '07 #5
comp.lang.php wrote:
On Jan 28, 2:56 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>comp.lang.ph p wrote:
>>On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.ph p 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...@at tglobal.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.


I tried with a very simple one-liner script:

<?php

print_r("hello world");
>>

And that is exactly what I see instead of "hello world"

Phil
You said earlier that your code was "surrounded with PHP tags", but what you
have posted has no ending tag.
Jan 28 '07 #6


On Jan 28, 3:18 pm, "Paul Lautman" <paul.laut...@b tinternet.com>
wrote:
comp.lang.php wrote:
On Jan 28, 2:56 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.php wrote:
>On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.p hp 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...@att global.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.
I tried with a very simple one-liner script:
<?php
print_r("hello world");
And that is exactly what I see instead of "hello world"
PhilYou said earlier that your code was "surrounded with PHP tags", but what you
have posted has no ending tag.
blah.php:

<?php print_r("hello world"); ?>

That is literally what I have. The end tag didn't paste onto this
message thread for some wacko reason, however, it still prints out
source code instead of "hello world"

Jan 28 '07 #7
comp.lang.php wrote:
>
On Jan 28, 2:56 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>comp.lang.ph p wrote:
>>On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.ph p 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...@at tglobal.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.


I tried with a very simple one-liner script:

<?php

print_r("hello world");

?>

And that is exactly what I see instead of "hello world"

Phil
OK, and you are entering from a command line:

php example.php

-q shouldn't affect the execution of the program, but you should try
leaving it off.

Also, ensure you don't have ANY other file with the filename "php" - it
could be php.exe, php.bat or php.com, for instance.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jan 28 '07 #8
Rik
Paul Lautman <pa**********@b tinternet.comwr ote:
><?php

print_r("hello world");
>>>

And that is exactly what I see instead of "hello world"

Phil
You said earlier that your code was "surrounded with PHP tags", but what
you
have posted has no ending tag.
Oh yes there was. Please do not trust Google Groups in this... It has the
tendancy to replace ?on the first line to a simple >

Unfortunately, I have no further insights for the OP.
--
Rik Wasmus
Jan 28 '07 #9


On Jan 28, 3:34 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.php wrote:
On Jan 28, 2:56 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.php wrote:
>On Jan 28, 1:58 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
comp.lang.p hp 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...@att global.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.
I tried with a very simple one-liner script:
<?php
print_r("hello world");
?>
And that is exactly what I see instead of "hello world"
PhilOK, and you are entering from a command line:

php example.php

-q shouldn't affect the execution of the program, but you should try
leaving it off.

Also, ensure you don't have ANY other file with the filename "php" - it
could be php.exe, php.bat or php.com, for instance.
Nope, all there is is php.exe, I checked
>
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Jan 28 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3081
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use the recordset to loop thru the recordset, update values from the recordset and then update the database by passing parmeters to another stored procedure. I would like to use the recordset object but can it be used to pass a parameter to a stored...
8
1333
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland newsgroups I learned that there is a function in stdlib.h called system. int system(const char *command); First question, is the system command ANSI compliant. Because I include <cstdlib> and write std::system(command.c_str()); it looks like an...
15
7907
by: Sokar | last post by:
Hello, I am writing a script which is using the system() command. In the script the system command invokes an encryption with system("gpg -f file.txt"). The problem comes when the script is required to perform this operation on different files which the user selects via another function. The name of the filename is stored in a variable as a string and I can't get the variable substituted into the ststem
2
2472
by: Raquel | last post by:
Why can we not give db2 System commands (commands starting with 'db2' like db2ilist, db2look, db2move etc.) through the Command Center? It is so convenient to retrieve and change commands in the Command center but this facility does not seem to exist for System commands. Seems command Window and CLP are the only places where we can interactively issue these commands..darn it!!! Regards, Raquel.
12
5337
by: Rhino | last post by:
I am having an odd problem: the sqlj command on my system doesn't work. I am running DB2 (LUW) V8 (FP8) on WinXP. I haven't done an sqlj program since Version 6 of DB2 (LUW) so I checked the manuals for the proper techniques to prepare an sqlj program. When I went to try the sqlj command, I got this: Exception in thread "main" java.lang.NoClassDefFoundError: sqlj/tools/Sqlj
4
2865
by: FluffyCat | last post by:
New on November 29, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Command Pattern. Since you all enjoyed the Visitor Pattern so much yesterday, today I have the Command Pattern for you. This one is pretty straight forward. In the Command Pattern an object encapsulates everything needed to execute a method in another object. http://www.fluffycat.com/SDCMSv2/PHP-Design-Patterns-Command/
5
16957
by: Good Man | last post by:
Hi there I am trying to execute a custom-built java program on my linux server via PHP. Basically, a user uploads files via PHP, and then the java program performs some action on these files. I have successfully had other operations performed on these files by using backticks, ie: $doit = `my exec command`;
11
2717
by: jobs239 | last post by:
Can I use this line inside C program "system(java -jar <jarfilename>)" to run a java program from C? Or do I have to use some JNI interface.?
5
2473
by: Odd Bjørn Andersen | last post by:
I have installed DB2 9 Enterprise Edition on my laptop and created the sample database. Now I'm having truble connecting to the database from Command Editor. If I connect from Command Window it's no problem connecting to sample (or any other databases - local or remote), but if I try to connect from Command Editor I'm not able to do that. There is no error message, the Progress dialog just run and run without anything happening. Is this...
2
10010
by: Gil_H | last post by:
Hi, I'm trying to run a script over unix on a remote machine. In order to automate it, the procedure requests the following: 1. Using SSH connection. 2. Operating a command on the remote machine. 3. Expecting password or (yes/no) request and authorize it. I get an error (I thing that it occures at the last part (3) of the password request).
0
7862
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8223
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6634
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5398
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2372
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1459
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1196
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.