Search code examples
phpubuntushorttags

PHP command in Ubuntu returning text of PHP file


I've been trying to run my PHP scripts on my Ubuntu 13.10 machine, but unusually it returns the PHP file contents.

php -q discover/server.php
<?

// configuration settings
require "config.php";

function pollCallback()
{
        $poller = new Poller_Discover ();
        $poller->check ();
}

$daemon = new Core_Daemon ( 'pollCallback', true );

I find this very unusual because I have already turned PHP's enable_short_tag configuration on.


Solution

  • You should try enabling short tags in the appropriate php.ini file which is being used by the CLI php command. Its location might be distribution-dependent.