1

I've downloaded a module library for Yii in which every PHP file starts with this:

<?

...rather than:

<?php

On my local Apache server, these files get loaded as flat files, rather than as executable scripts, though the files are all modded as writable and executable. Is there a way to force these files to be run as PHP, or do I have to modify all the files (and there are probably a hundred of them).

Andrew
  • 14,204
  • 15
  • 60
  • 104

3 Answers3

6

You will have to enable short_php_tag from php.ini Or better change <? to <?php in your file.

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 inline. Otherwise, you can print it with PHP, for example: '; ?>'. Also, if disabled, you must use the long form of the PHP open tag ().

Sarfraz
  • 377,238
  • 77
  • 533
  • 578
4

You need to activate the

short_open_tag

in the php.ini from "Off" to "On". Dont forget to reload/restart the apache

Sliq
  • 15,937
  • 27
  • 110
  • 143
2

you can add a .htaccess file with the following line to make it work: php_value short_tags on

Raab
  • 34,778
  • 4
  • 50
  • 65