Running a PHP script in the console

I try to execute php in the console, but every time I run it:

php myscript.php

it only displays the contents of the file; it does not run it. Output:

<?
echo 'test';
?>

instead:

test

What happened? My php is installed under c: / program files / php and the environment variable is set.

Thank,

Dave

+5
source share
4 answers

Try

<?php

May be short_open_tagdisabled in your php.ini

PHP, (<? ?>) PHP. PHP XML, , <?xml ?> inline. PHP, : <?php echo '<?xml version="1.0"?>'; ?>. , , PHP (<?php ?>).


: ?

+6

Try:

<?php

<?

( , PHP .)

+4

. <? <?php.

+1

<?php <?

. -n cmd, PHP ini,

+1

All Articles