0

After recently updating to Debian 8.0, and hence PHP 5.6 (PHP 5.6.7-1 (cli) (built: Mar 24 2015 12:30:15))

A bunch of my PHP scripts seem to have broken. Most specifically, now when running a PHP script through the command line, it seems to simply output the actual script. I think it might have something to do with the new php.ini that (mistakenly) got installed. But I'm not sure exactly what I'm missing..

[server~] php5 p.php
<?
exec("whoami");
?>

[server~] /usr/bin/php p.php
<?
exec("whoami");
?>

[server~] ./p.php
<?
exec("whoami");
?>

[server~] cat p.php
#!/usr/bin/php
<?
exec("whoami");
?>

1 Answer 1

2

You are using short tags <?. Get used to using <?php to open PHP code blocks.

You can change the setting in php.ini under short_open_tag. But I think it is better practice to use <?php.

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

1 Comment

Thanks. I literally just figured this out as you commented.

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.