Question

Moving of servers- Apache PHP4 to IIS7 and PHP 5 - code showing?

Asked by: Mathiau

I am moving some old webservers we have over to new hardware and new systems, since our past guy left some time ago.

i am an IIS man personally, we host many sites and i just prefer IIS and it's header abilities and interface.

Anyways.

we have a customer service system which is currently running under:

Windows Server 2003 x32 SP1
Apache 2.0.53
PHP 4.3.10


The new system is

Windows Server 2008 Web Edition x64
IIS 7
PHP 5.2.6 running under ISAPI mode


Upon testing out some pages, it seems some tags or something aren't being properly read and the result is code showing after certain items, i have attached 2 images (some text seems weird as i blocked it out) but you can clerly see the code showing, when it shouldnt..

is this something with the settings on the PHP file, or how IIS is serving out the pages?

i have global variables on under the php.ini, unfortunately the past coder coded with that on (working on that next) other then that the php.ini is default settings except for setting the ext directory.

All help is greatly appreciated!

  • iis7.JPG
    • 23 KB

    System under IIS7 not looking so good...code showing

    System under IIS7 not looking so good...code showing
  • apache.JPG
    • 13 KB

    System under Apache Proper looking

    System under Apache Proper looking

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-11-12 at 12:32:55ID23899688
Tags

PHP

,

MYSQl

,

IIS7

,

Apache

,

Windows

,

Server 2008

,

2008

Topics

PHP for Windows

,

PHP Scripting Language

,

Microsoft IIS Web Server

Participating Experts
1
Points
500
Comments
34

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Increasing timeout in php.ini and apache
    Hi How do I increase the timeout in PHP and Apache? I changed in php.ini: max_execution_time = 300 max_input_time = 300 and in httpd.conf to put this: Timeout 300 but it doesn't do the trick. What am I missing? tr5
  2. Configuring PHP and Apache - Specifically php.ini
    I've got a bit of issue with configuring Apache and PHP to work together. Ive attached the results of a <?php phpinfo(); ?> I cant get the 'Configuration File (php.ini) Path ' to point to 'D:\tools\php-5.2.6-Win32\php.ini ' which is where the php.ini file is. It cont...
  3. Configuring Apache for PHP
    Hello: I have done all I could to configure Apache to run PHP, but nothing works. When I type http://localhost on a browser, it always generate page not found. However, if add test.html, it displays the page correctly. This led me believe that some how Apache is not recogniz...
  4. apache with multiple php.ini
    Hi, I have this apache http.conf file. I have managed to successfully set up localhost2; however, when I check the Loaded Configuration File to the php.ini file it states: "C:\Program Files\Zend\Core\etc\php.ini" But the httpd.conf states: DocumentRoot "C:/Pr...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: MikealclPosted on 2008-11-12 at 12:43:07ID: 22943940

ditch the ISAPI mode and use FAST-CGI.




 

by: MikealclPosted on 2008-11-12 at 12:44:18ID: 22943954

http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04/

Can't find the notes I kept from my last install but this website looks decent.

 

by: MikealclPosted on 2008-11-12 at 12:44:51ID: 22943961

Oh and you might have to enable the short tagging too i always forget to change that.

 

by: MathiauPosted on 2008-11-12 at 12:54:42ID: 22944065

do you think it is the ISAPI mode causing it?

guess i can test and find out :D, so used to using the ISAPI mode.

 

by: MikealclPosted on 2008-11-12 at 12:57:24ID: 22944092

I had issues with ISAPI in 2k8, but when I went to find answers online everyone told me FASTCGI was the way to go.

It's worked great for me so far, and you get a performance increase.

 

by: MathiauPosted on 2008-11-12 at 13:06:09ID: 22944190

trying it out now! will let you know how it goes in a few minutes, great guide on that site

 

by: MathiauPosted on 2008-11-12 at 13:18:13ID: 22944308

so i got fastCGi in and php info works, now i need to add mysql support, but the ini has no area to uncomment dll files for mysqli, it seems the mysql is built into the php file... but the pages aren't working for me (had them working with ISAp)

 

by: MathiauPosted on 2008-11-12 at 13:23:27ID: 22944372

re-ra the installer and added the mysql ext from the installer :D

 

by: MikealclPosted on 2008-11-12 at 14:02:31ID: 22944781

Cool so you got everything fixed up now?

 

by: MathiauPosted on 2008-11-12 at 14:17:05ID: 22944927

i decided to reformat the system and put in the .exe for now, get ride of all the lingering messing around i did.

just rebooted, got everything installed,php works, shows mysql and mysqli installed but now i get a massive line of text with errors on it L:( about prasing errors and i followed that guide to a T, enabled global variables :(

at least with the ISAPI module i could get the pages to show and work, just showed the code after it :(

 

by: MathiauPosted on 2008-11-12 at 14:17:59ID: 22944936

Now i get 500 internal server error trying to load a page in a sub directory of the root... 500 usually permission problems isnt it

 

by: MathiauPosted on 2008-11-12 at 14:20:09ID: 22944965

well it isn't a permission issue on the sub folders as i can view image files fine with out any errors....

http://localhost

then i have

http://localhost/csis/
http://localhost/csis/images

 

by: MikealclPosted on 2008-11-12 at 14:20:33ID: 22944971

You want to enable the better error messages

http://blogs.iis.net/rakkimk/archive/2008/10/03/iis7-enabling-custom-error-pages.aspx

Let me know what it says with the errors enabled.

 

by: MikealclPosted on 2008-11-12 at 14:21:17ID: 22944979

Did you set the default document?

 

by: MathiauPosted on 2008-11-12 at 14:29:55ID: 22945068

i am using a direct URL to the file


http://localhost/csis/index.php

enabling the better errors now!


the help is really appreciated Mikealcl! i was going at this for about 5 hours before i even posted on here  :D

 

by: MikealclPosted on 2008-11-12 at 14:31:53ID: 22945086

I did this all last summer.  Little painful but I like iis7 much better.

Few of my other notes I found on my blog. http://tech.mikeal.com/blog1.php/2008/08/


 

by: MathiauPosted on 2008-11-12 at 14:38:01ID: 22945141

okay so i turned those on, seems some html file was missing it was looking for, i added the HTML file and now i am back to where i was with the code showing again after words like my original post :(

 

by: MathiauPosted on 2008-11-12 at 14:38:45ID: 22945151

now taking out the .html file again i noticed 2 other errors

PHP Warning:  fgets(): supplied argument is not a valid stream resource in D:\wwwroot\csis\index.php on line 2364
PHP Warning:  fclose(): supplied argument is not a valid stream resource in D:\wwwroot\csis\index.php on line 2365
                                              
1:
2:

Select allOpen in new window

 

by: MikealclPosted on 2008-11-12 at 14:41:08ID: 22945174

Did you register .php files in IIS?

That post almost looks like its just processing it like html

 

by: MathiauPosted on 2008-11-12 at 14:53:05ID: 22945292

yes, if i put back the HTML file, i can access the main index.php page, but with that code showing, i can search for accounts and such and get the info, so the php is working, also php info test script i did also works showing all the info for php.

 

by: MikealclPosted on 2008-11-12 at 14:56:25ID: 22945314

Did you enable short tags "?>" instead of php> in the php.ini???

 

by: MathiauPosted on 2008-11-12 at 15:15:23ID: 22945481

that i didnt! trying now!

 

by: MathiauPosted on 2008-11-12 at 15:19:36ID: 22945512

enabled short tags, rebooted server, now i get the 500 server error again :(

leaving work now, but will keep trying on this from home.

 

by: MathiauPosted on 2008-11-14 at 10:40:43ID: 22962302

so back at work testing some things out, and so far no, go, turning short tags on and off cause it to work then not work.

 

by: MathiauPosted on 2008-11-14 at 10:59:00ID: 22962439

So just did this

i did a find and replace and replaced all instances of <? with <?php

now getting these errors and nothign else on the page, so checking the files to see what the problem is

PHP Notice:  Undefined variable: status in D:\wwwroot\csis\index.php on line 1894
PHP Notice:  Undefined variable: auth in D:\wwwroot\csis\index.php on line 1913
PHP Notice:  Undefined variable: auth in D:\wwwroot\csis\index.php on line 1932
                                              
1:
2:
3:

Select allOpen in new window

 

by: MathiauPosted on 2008-11-14 at 11:02:54ID: 22962471

okay, not what i was hoping to see as doesnt make sense to me

line 1894          </table></td>
line 1913            print("<TR><TD>");
line 1932                  print("<LI><FONT COLOR=\"#000000\" FACE=\"Verdana\" STYLE=\"font-size: 8pt\"><a href=\"index.php?hostnote=MYNOTES\" target=\"_self\" title=\" notes I have done in the last 24 hours\">My Notes</a></font> ");

now the notes part should work.... is some tag possibly missing? in the first 2 lines i dont see any variable that would be need to be defined.

 

by: MikealclPosted on 2008-11-14 at 11:31:59ID: 22962734

did you forget to also replace ?> with php?> ??


 

by: MathiauPosted on 2008-11-14 at 11:43:41ID: 22962844

are you supposed to do that.

i have a php test script and if i change the ending ?> to php?> i get errors


first bit works fine

<html>
<head>
<title> PHP Test Script </title>
</head>
<body>
<?php
phpinfo();
?>
</body>
</html>


if i change it to php?> i the this error

PHP Notice:  Use of undefined constant php - assumed 'php' in D:\wwwroot\phpinfo.php on line 8

so i assume your only supposed to use the php on the first section

 

by: MikealclPosted on 2008-11-14 at 12:21:43ID: 22963185

hmm I'm not sure I always use short tags.


 

by: MathiauPosted on 2008-11-18 at 14:28:02ID: 22989623

i am going to try and install apache wit php5 and see if the same problem occurs or not.

 

by: MathiauPosted on 2008-11-19 at 09:35:56ID: 22996604

okay, well some progress

with apache 2.2 and php 5..

i loaded up a page and it had the same issues as IIS, so it seems it is not server based.

I looked up the code on one page and the first part has

<?php

then some code

then he has a section php part, but it starts with

<?

changing the <? to <?php on this page resolved the showing code!

so i am now going to check on the main page to see what line i can edit to make the code dissappear! wish me luck!

 

by: MathiauPosted on 2008-11-19 at 09:38:35ID: 22996625

woo hoo, replaced one further down and the code that was showing isnt, so far, going to install IIS now and set that up again and see if the results are the same!

 

by: MathiauPosted on 2008-11-19 at 13:13:32ID: 22998636

well seems i cant get it to work under IIS7 now at all, so i may have to stick with apache on this one, as long as i can figure out headers and such, i should be "okay"

 

by: MathiauPosted on 2008-11-19 at 13:15:09ID: 31516108

mike gave me great info on learning IIS7, and great links which got me going in a good direction, when i have more free time i will be sure to conquer this matter!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...