0

I'm trying to get the php executable to parse scripts, but it's not working. i run something like this:

php c:\test.php

and test.php contains this:

<?
echo 'hello!';
?>

and that is exactly what running the command returns. It returns the raw code. How can I get it to actually parse the code and return "hello!" instead?

4 Answers 4

3

Make sure you have the short_open_tag setting enabled in your php.ini. Failing that, use the ever-so-slightly longer <?php to start your script.

Sign up to request clarification or add additional context in comments.

Comments

1

Another option might be to try using the -f command line option.

php -f c:\test.php

Comments

0

It's been a while since I've ran php off the command line, but try this:

<?php
echo 'hello!';
?>

Comments

0

Also make sure that your webserver is correctly configured. If it is not configured to run .php pages through the php interpreter it may simply display as a text file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.