i'm trying to execute a php in the console, but each time i run it:
php myscript.php
it only outputs the content of the file, it dowsn't run it. output:
<?
echo 'test';
?>
instead of:
test
What's wrong? I have php installed under c:/program files/php and the environment variable is set.
Thanks,
Dave
Try
<?php
It might be short_open_tag
is disabled in your php.ini
Tells PHP whether the short form (
<? ?>
) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use<?xml ?>
inline. Otherwise, you can print it with PHP, for example:<?php echo '<?xml version="1.0"?>'; ?>
. Also, if disabled, you must use the long form of the PHP open tag (<?php ?>
).
Edit: You might also want to read Are Short Open Tags Acceptable To Use?
Try:
<?php
instead of
<?
(if that works you may need to configure your installation of PHP to enable short tags.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With