Page 1 of 1

short_open_tag directive (Win7) 1.7.7 [SOLVED]

PostPosted: 14. December 2011 13:36
by LeDavid

I have noticed that the short_open_tag directive is "On" in the PHP configuration file for the 1.7.7 XAMPP release.
I want to disabled it as recommended but when I do so Xampp pages such as head.php doesn't work anymore because short form (<? ?>) of PHP's open tag are still used in it.

Is it possible to change this in the next release?

Re: short_open_tag directive

PostPosted: 14. December 2011 22:14
by Sharley
It has been mentioned to the developers when it was first discovered some time back and hopefully it will be corrected in XAMPP.

It seems that the default for this directive has been returned to On by PHP not by XAMPP developers because of the many problems it triggered when the default was changed to Off.

It is best practice not to use the short version of this tag but there are many scripts still in use that have not been updated and there are still many coders using the short version.

I have once again mentioned it to the developer to have the long tag used instead of the short tag in those files affected and hopefully they will be changed to the long tag format in the next release for a more permanent solution for everyone.

Bets wishes.

Re: short_open_tag directive

PostPosted: 15. December 2011 00:18
by Altrea
You can tweak it yourself with nearly no effort.

- Open your \xampp\apache\conf\extra\httpd-xampp.conf file
- search for your <Directory "C:/xampp/htdocs/xampp"> line (~ line 66 - can be slightly different depending on your install directory)
- Inside this <Dicectory>-Block search for the </Files> and add AFTER:
Code: Select all
php_admin_flag short_open_tag on

- safe this file and restart your Apache

Now you can safely set short_open_tag inside your php.ini to Off without losing the functionality of the XAMPP Administration page

For your overview, here the whole <Directory>-Block how it looks like in my own configuration (be careful, i have installed XAMPP to a different directory)

Code: Select all
<Directory "C:/xampp177/htdocs/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
    php_admin_flag short_open_tag on
    AllowOverride AuthConfig

best wishes,

Re: short_open_tag directive

PostPosted: 16. December 2011 19:32
by LeDavid
Altrea wrote:
Code: Select all
php_admin_flag short_open_tag on

Great solution.
I didn't notice there was a a special Xampp configuration file in that directory.

Thanks a lot.