php short tags

Im running cent x64 2gigs ram

php.x86_64 5.3.3-3.el6_2.6 @updates
php-cli.x86_64 5.3.3-3.el6_2.6 @updates
php-common.x86_64 5.3.3-3.el6_2.6 @updates
php-gd.x86_64 5.3.3-3.el6_2.6 @updates
php-imap.x86_64 5.3.3-3.el6_2.6 @updates
php-mbstring.x86_64 5.3.3-3.el6_2.6 @updates
php-mysql.x86_64 5.3.3-3.el6_2.6 @updates
php-odbc.x86_64 5.3.3-3.el6_2.6 @updates
php-pdo.x86_64 5.3.3-3.el6_2.6 @updates
php-pear.noarch 1:1.9.4-4.el6 @base
php-pgsql.x86_64 5.3.3-3.el6_2.6 @updates
php-snmp.x86_64 5.3.3-3.el6_2.6 @updates
php-xmlrpc.x86_64 5.3.3-3.el6_2.6 @updates
wbm-php-pear.noarch 2:1.5-1 @virtualmin-universal

Ive got a php script that I bought that insists on using short tags in every file… i see its turned off by default in php 5

Webmin->Php Configuration->Other Settings

and set to yes
Allow PHP scripts starting with <? ?

I should be done right? I restarted apache… still nothing… the php file when called from a browser just shows the php code so I know its not seeing the short tags for some reason.

If I do the <?php tag it works great but I dont want to change this tag on 2000 scripts and what about updates? Id rather keep short tags on till they update their script. I already told them to.

I read in a php book the following:

Choose the --enable-short-tags configuration option when you’re building PHP.

✦ Set the short_open_tag setting in your php.ini file to on. This option must be
disabled to parse XML with PHP because the same syntax is used for XML tags.

So it looks like even though I turned allow on it wont do anything until I re-make the php file…is that right??? If so how do i do that?



The PHP config you’re changing is the version in /etc/ – but your domain has it’s own php.ini file located in $HOME/etc/php.ini.

What you would want to do is tweak $HOME/etc/php.ini with that setting, and then you should be good to go!


Hi Eric,

Is there a way to do this in virtualmin / webmin?

I went in with SSH and did a whereis

[root@test bin]# whereis php.ini

php: /usr/bin/php /etc/php.d /etc/php.ini /usr/lib64/php /usr/share/php /usr/share/man/man1/php.1.gz

So I dont have a $HOME/etc/php.ini file as you mentioned. Should I create one there? Im using the latest 64 bit centos.

Thanks again.

ok I figured it out!

Go to virtualmin

Select the virtual server from the dropdown on the upper left

Click the services menu

Select PHP 5 Configuration

Click on the Other Settings icon on the right

Set Allow PHP scripts starting with <? ? to Yes

Click the save button.

Thanks to Eric and everyone who helped!

Great, glad you got it working!