short_open_tag directive (Win7) 1.7.7 [SOLVED]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

short_open_tag directive (Win7) 1.7.7 [SOLVED]

Postby LeDavid » 14. December 2011 13:36

Hello,

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?
LeDavid
 
Posts: 2
Joined: 14. December 2011 13:24
Operating System: Windows 7

Re: short_open_tag directive

Postby Sharley » 14. December 2011 22:14

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.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: short_open_tag directive

Postby Altrea » 15. December 2011 00:18

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
       </Files>
    php_admin_flag short_open_tag on
    </IfModule>
    AllowOverride AuthConfig
</Directory>


best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: short_open_tag directive

Postby LeDavid » 16. December 2011 19:32

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.
LeDavid
 
Posts: 2
Joined: 14. December 2011 13:24
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 46 guests