Jump to content

[SOLVED] PHP Command Line


The Little Guy

Recommended Posts

When I type in:

php test.php

 

All that happens is the Command line prints out the files contents.

 

 

C:\Program Files\xampp\htdocs\publicsize\robots>php test.php
<?
echo "hello";
?>

 

How can I get it to execute the code? When I ran the php installer, I installed it as "Other CGI", there wasn't a "PHP CGI Binary" to select from.

Link to comment
https://forums.phpfreaks.com/topic/54346-solved-php-command-line/
Share on other sites

When I type in:

php test.php

 

All that happens is the Command line prints out the files contents.

 

 

C:\Program Files\xampp\htdocs\publicsize\robots>php test.php
<?
echo "hello";
?>

 

How can I get it to execute the code? When I ran the php installer, I installed it as "Other CGI", there wasn't a "PHP CGI Binary" to select from.

Your php configuration probably doesn't have the short_open_tag directive enabled in the php.ini. INMO you should not code with short tags. Using the full tags allows your application to be more portable over different php setups.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.