Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIS 7.5 PHP 5.3.5 cannot use short_open_tag

Status
Not open for further replies.

Bahamut666

IS-IT--Management
Feb 12, 2005
11
CA
I understand this is depricated and should be turned off but I am doing a course and need to turn it on.

using phpinfo() I see

Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\Program Files (x86)\PHP\php.ini

now both versions of this file have been updated and saved so that short_open_tag=on

in the phpinfo() I see

local Master
short_open_tag Off Off

I have restarted IIS and I have gone so far as restarted the computer but this option remains the same.

Is there somethign I am missing or someplace else the server may be getting an override setting? Any help with this would be greatly appreciated as I have working on this for 4 days now.
 
Hi

Bahamut666 said:
I understand this is depricated
Once I also read such thing somewhere, but the documentation says nothing against it.

Bahamut666 said:
in the phpinfo() I see
And what appears from the command line ? Run [tt]php -i[/tt] from [tt]cmd[/tt].

Sorry for the question, but we not know how beginner you are. The [tt]short_open_tag = On[/tt] line in the php.ini, surely has no semicolon ( ; ) character at the beginning of line ?

Feherke.
 
haha have no fear I am experienced enough in pcs to know that the basics if not stated need to be asked just to place everyone on a level playing field. I pasted it from the web display of the results of loading the page.

As for the deprecation yes I agree I read it should work by some servers may run into issues with conflicting tags from other languages being parsed. My setup is plain IIS install nothing fancy changed plain PHP with only this change fromt eh defaults. the only other thing I have installed is MySQL and it is sitting as the default instal have not changed any settings in that.

The line is not commented out in the ini file so no there is no ; at the start of the line.

Below is a copy of the system settings section of the info page.

Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--disable-isapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet" "--with-mcrypt=static"
Server API CGI/FastCGI
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\Program Files (x86)\PHP\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20090626
PHP Extension 20090626
Zend Extension 220090626
Zend Extension Build API220090626,TS,VC9
PHP Extension Build API20090626,TS,VC9
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
Registered Stream Socket Transports tcp, udp, ssl, sslv3, sslv2, tls
Registered Stream Filters convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*, bzip2.*

Link attacked to complete display from the php -i cmd.
 
 http://www.mediafire.com/?82r6oqj28ipd9w2
Hi

Bahamut666 said:
Link attacked to complete display from the php -i cmd.
Hmm... That looks incomplete. The Core section which contains the [tt]short_open_tag[/tt] status is missing.

I am asking about this because I am suspecting that your server runs PHP as module and it uses other settings. However I not know IIS.


Feherke.
 
Yes I thought that too when I looked at it so incresed my buffer size and reran the cmd. I have the complete listing now but as I pasted in my original post short_open_tab setting in the display is off off but it is enabled in the php.ini file so i hve no idea where it is getting the off setting from.
 
 http://www.mediafire.com/?4dda7ul4399dcvv
Hi

When PHP runs as module in Apache, the web server's configuration files can contain [tt]php_flag[/tt] directive to set it :
Code:
php_flag short_open_tag off
The PHP: How to change configuration settings documentation page have some comments about IIS too, but I do not understand them. See if you can use them.


Feherke.
 
Yes I have read through the documentation here is how IIS handles the same thing in the php.ini file

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full <?php and ?> tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.
; Default Value: On
; Development Value: Off
; Production Value: Off
; short_open_tag = On

notice I have it set as on and the ";" has been removed fromt he front of the line.

I have tried everything I can think of and looked at all the things mentioned so far to no end.

I have gone so far as to instal a vm LAMP appliance and try using that instead but for some reason even that does not work using the short tags. though this is a minor thing really as it can be ignored it is soemthing that is bugging me as I now start wondering what other options I change in the future that are not going to work either.
 
Hi

Bahamut666 said:
here is how IIS handles the same thing in the php.ini file
Not IIS handles those settings as php.ini is PHP's configuration file, not IIS's.

The [tt]php_flag[/tt] directive I mentioned above, is the Apache web server module's configuration. If that exists, overrides the php.ini's settings. ( But not affects the PHP interpreter run from the command line. That is why I asked what appears there. )

No idea if your IIS runs PHP as module and if such module can have its own configuration in IIS. But the symptoms are very similar, so I would check it.


Feherke.
 
Thanks for clarifing that for me I will look into that in more depth.

Question I have about that though when I ran the php -i command and it showed the directive as off as well would that not eliminate an iis configuration error since it is runing the php program by itself to get the configuration information and not going through the web browser?
 
Yes I suspect the issue is with IIS and some default setting in there that is overriding the PHP.ini file settings but I cannot fid any registry setting or anything in the server mgmt console that would be causing the issue.
 
As an update to this issue. I have fixed the problem.

I ended up removing PHP from the server and installing it from inside IIS7.5 when I did this it installed a PHP Managment tool from inside that you can change all the setting in the ini file.

The interesting thing to note about all this is that the management tool gives you some recommendations for settings that are not configured optimally one of these settings is to have IIS monitor changes to the php.ini file. I guess by default IIS 7.5 will read the ini file upon installation and then ignore any changes made to that file regardless of whether you restart the service or server unless you make this recommended change.
 
If that's the case you would never be able to make any changes to the php.ini under IIS.
MS love PHP so I wonder if there has been some tinkering going on!
 
I cannot say what happened I am new to both IIS and PHP and it was a fresh install of both on my fairly resent Win7(x64) refresh.

I could very well have missed a step in the original install of PHP since the management applet never did get installed in IIS until I went back and added PHP from inside IIS. If that had been there I would have found the problem right away. Or more likely I would have bypassed the problem by setting it from the applet instead of via the ini file and never would have seen this issue.

Thought I would point out my mistake and have it online incase someone else should run into the same or similiar problem in the future. It might be typical MS tweaks and maybe the PHP installer just has not caught up with the change to IIS 7.5 yet? who knows. Might just have been my inexperience with the 2 applications and missing a step or option in the setup.
 
Always welcome when people document thier own solution, as you say you might do a google and find your issue and find no one fixed it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top