The Little Guy Posted June 5, 2007 Share Posted June 5, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/54346-solved-php-command-line/ Share on other sites More sharing options...
per1os Posted June 5, 2007 Share Posted June 5, 2007 What version of PHP? Newer versions do not allow the <? tag instead it has to be <?php http://us2.php.net/features.commandline I would suggest reading through that. Quote Link to comment https://forums.phpfreaks.com/topic/54346-solved-php-command-line/#findComment-268753 Share on other sites More sharing options...
The Little Guy Posted June 5, 2007 Author Share Posted June 5, 2007 Never mind I got it, the php requires long hand php, not short hand like so <?php and not <? Quote Link to comment https://forums.phpfreaks.com/topic/54346-solved-php-command-line/#findComment-268754 Share on other sites More sharing options...
wildteen88 Posted June 5, 2007 Share Posted June 5, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/54346-solved-php-command-line/#findComment-268755 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.