最近接了个活,,服务器是iis 的,,,
我的代码在我自己的电脑上运行正常 ,但在服务器上支持失败。
后来查看后是 服务器不支持 <?=$value ?> 这种写法,只支持<?php echo $value;?>,服务器不能正确解析,他会直接显示输出我的源代码?
,,但我的项目都要交付了,有很多<?=$value ?>这种写好,,要改成<?php echo $value;?> 不太实际。高高手求高高手解决是否在IIS上要做什么配置。或要怎么配置 php.ini 文件。。在线等!
我的代码在我自己的电脑上运行正常 ,但在服务器上支持失败。
后来查看后是 服务器不支持 <?=$value ?> 这种写法,只支持<?php echo $value;?>,服务器不能正确解析,他会直接显示输出我的源代码?
,,但我的项目都要交付了,有很多<?=$value ?>这种写好,,要改成<?php echo $value;?> 不太实际。高高手求高高手解决是否在IIS上要做什么配置。或要怎么配置 php.ini 文件。。在线等!
你可以试着批量替换<?=$value ?>
PHP Version 5.2.3System Windows NT WOLFGROUP 5.2 build 3790
Build Date May 31 2007 09:36:39
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File C:\WINDOWS\php.ini
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.* This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies空间服务器的配置 (IIS)PHP Version 5.2.10System Windows NT SINOCOM-P426603 5.2 build 3790
Build Date Jun 17 2009 16:16:01
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template" "--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"
Server API CGI/FastCGI
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File C:\PHP5\php.ini
Scan this dir for additional .ini files (none)
additional .ini files parsed (none)
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.2.0, Copyright (c) 1998-2006, by Zend Technologies
在php.ini文件里搜索“short_open_tag”,把它的值改成“On”就可以了再重启一下运行环境就好了!
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On
http://hi.baidu.com/tianliao1988/blog/item/2703b402507a977f3812bbf0.html
给你一个php.ini的中文版,这个可能对你有帮助!