plusnplus Posted December 14, 2010 Share Posted December 14, 2010 hi.., i have pc development, using win xp sp3, apache+mysql+php the code/ webpage work prefect. i have intranet server, using ubuntu 10.04, apache+mysql+php the code/ webpage work prefect. but.., when i copy to live web server, using win server 2008, apache+mysql+php, all php code show in broswer. if there is a html code, it show correctly, but the php code, show just like text in the browser. how to solve this problem? thanks for any help/ info Quote Link to comment Share on other sites More sharing options...
trq Posted December 14, 2010 Share Posted December 14, 2010 How exactly was php installed on the live server? it would seem it is misconfigured. Quote Link to comment Share on other sites More sharing options...
plusnplus Posted December 15, 2010 Author Share Posted December 15, 2010 How exactly was php installed on the live server? it would seem it is misconfigured. first, i install apache 2.2 installer 2nd, install mysql installer 3rd, install php installer (during process, select web server and loc of conf file) that's all. any file( *.dll) i should copy to some folder? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 15, 2010 Share Posted December 15, 2010 It would help if you showed what opening php tag you are using in your code. Quote Link to comment Share on other sites More sharing options...
plusnplus Posted December 15, 2010 Author Share Posted December 15, 2010 It would help if you showed what opening php tag you are using in your code. after i put <?php ( before just <? ), it work properly. since so many pages (more then 200) I need to update, any other way beside that update opening tag? i just wonder, why apache+mysql+php in windows server 2008 need this opening tag? my intranet server, using ubuntu 10.04, without that (<?php), the web page work properly. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted December 15, 2010 Share Posted December 15, 2010 This is why you should always write php code with the full <?php open tag syntax. If you didn't have control over the php.ini file, you'd be forced to go through and change all of the tags. Since you do have control over the php.ini file, you can change this line to On, and restart Apache. short_open_tag = Off Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 15, 2010 Share Posted December 15, 2010 It would take less than 5 minutes using a programming editor like notepad++ to globally search/replace all the files in your project's folder (using the replace in files menu) and you will never have this problem again. You have probably spent 4-5 orders of magnitude more time on this problem already than what it would take to fix it. Search and replace - 1) <? to <?php 2) <?phpphp to <?php 3) <?php= to <?php echo 4) Done! Quote Link to comment Share on other sites More sharing options...
plusnplus Posted December 15, 2010 Author Share Posted December 15, 2010 hi.., thanks to everyone the problem is solved now. i just replace all the open tag code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.