Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    apache migration to iis

    I have a Web site and MySQL db that works fine on apache. I moved the application to IIS. After doing all of the configuration steps, it appears to run php scripts on index.php but not on any of the other pages of the application. For example, on index.php I do a phpinfo() and it shows all the information. Partial output on IIS that I get is shown below for phpinfo()

    Server API CGI/FastCGI
    Virtual Directory Support disabled
    Configuration File (php.ini) Path C:\WINDOWS
    Loaded Configuration File C:\PHP\php.ini
    PHP API 20041225
    PHP Extension 20060613
    Zend Extension 220060519
    Debug Build no
    Thread Safety disabled
    Zend Memory Manager enabled
    IPv6 Support enabled
    Registered PHP Streams php, file, data, http, ftp, compress.zlib


    Yet, on all of the other pages it just splatters the php all over the page: Here are some example errors I am getting on one page:


    PHP Warning: include(/include/session.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 2 PHP Warning: include() [function.include]: Failed opening '/include/session.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 2 PHP Warning: include(/dinclude/dheaderclean.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 3 PHP Warning: include() [function.include]: Failed opening '/dinclude/dheaderclean.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 3 PHP Warning: include(/dheader.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 4 PHP Warning: include() [function.include]: Failed opening '/dheader.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 4 PHP Warning: include(/open_conn.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 5 PHP Warning: include() [function.include]: Failed opening '/open_conn.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 5 PHP Notice: Undefined variable: session in D:\Inetpub\wwwroot\wbase\main.php on line 32 PHP Notice: Trying to get property of non-object in D:\Inetpub\wwwroot\wbase\main.php on line 32 PHP Notice: Undefined variable: form in D:\Inetpub\wwwroot\wbase\main.php on line 53 PHP Notice: Trying to get property of non-object in D:\Inetpub\wwwroot\wbase\main.php on line 53

    Does anyone have any ideas on what I might be doing wrong? I have spent quite a few hours trying to figure this out and really could use some advice.

    Thanks

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The issue is the leading forward slash. Its telling the server to look at the root of the site for the include file. In this case the root is D: so its looking for the file here
    D:\include\session.php

    Try doing something like
    PHP Code:
    include($_SERVER['DOCUMENT_ROOT'].'/wbase/include/session.php'
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a million!

  • #4
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the help. I think you are right that this is the problem, but after making the change I get this:

    PHP Notice: Undefined index: DOCUMENT_ROOT in D:\Inetpub\wwwroot\wbase\main.php on line 7 PHP Warning: include(/wbase/include/session.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 7 PHP Warning: include() [function.include]: Failed opening '/wbase/include/session.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 7 PHP Notice: Undefined index: DOCUMENT_ROOT in D:\Inetpub\wwwroot\wbase\main.php on line 8 PHP Warning: include(/wbase/dinclude/dheaderclean.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 8 PHP Warning: include() [function.include]: Failed opening '/wbase/dinclude/dheaderclean.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 8 PHP Notice: Undefined index: DOCUMENT_ROOT in D:\Inetpub\wwwroot\wbase\main.php on line 9 PHP Warning: include(/wbase/dheader.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 9 PHP Warning: include() [function.include]: Failed opening '/wbase/dheader.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 9 PHP Notice: Undefined index: DOCUMENT_ROOT in D:\Inetpub\wwwroot\wbase\main.php on line 10 PHP Warning: include(/wbase/open_conn.php) [function.include]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\wbase\main.php on line 10 PHP Warning: include() [function.include]: Failed opening '/wbase/open_conn.php' for inclusion (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\wbase\main.php on line 10 PHP Notice: Undefined variable: session in D:\Inetpub\wwwroot\wbase\main.php on line 36 PHP Notice: Trying to get property of non-object in D:\Inetpub\wwwroot\wbase\main.php on line 36 PHP Notice: Undefined variable: form in D:\Inetpub\wwwroot\wbase\main.php on line 57 PHP Notice: Trying to get property of non-object in D:\Inetpub\wwwroot\wbase\main.php on line 57

    Any idea on what else to try?

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can you post the code (including the php) for main.php?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the help again. Here is the code for main.php

    PHP Code:
    <?php
    //include("/include/session.php");
    //include("/dinclude/dheaderclean.php"); 
    //include("/dheader.php");
    //    include("/open_conn.php");

    include($_SERVER['DOCUMENT_ROOT'].'/wbase/include/session.php');  
    include(
    $_SERVER['DOCUMENT_ROOT'].'/wbase/dinclude/dheaderclean.php');
    include(
    $_SERVER['DOCUMENT_ROOT'].'/wbase/dheader.php');  
    include(
    $_SERVER['DOCUMENT_ROOT'].'/wbase/open_conn.php');  
    //include("/Inetpub/wwwroot/wbase/include/session.php");

    /*
     * Main.php
     *
     * This is an example of the main page of a website. Here
     * users will be able to login. However, like on most sites
     * the login form doesn't just have to be on the main page,
     * but re-appear on subsequent pages, depending on whether
     * the user has logged in or not.
     *
    */

    ?>

    <html>
    <title>Login Script</title>
    <body>
    <table>
    <tr><td>

    <?php
    /**
     * User has already logged in, so display relavent links, including
     * a link to the admin center if the user is an administrator.
     */

    if($session->logged_in){
       echo 
    "<h4>Login Successful</h4>";
       echo 
    "Welcome <b>$session->username</b>, you are logged into the Dawson Permit Portal. <br><br>"
           
    ."[<a href=\"userinfo.php?user=$session->username\">Manage Permits</a>] &nbsp;&nbsp;"
           
    ."[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
       if(
    $session->isAdmin()){
          echo 
    "[<a href=\"admin/admin.php\">Admin Center</a>] &nbsp;&nbsp;";
       }
       echo 
    "[<a href=\"process.php\">Logout</a>]";
    }
    else{
    ?>

    <h3>Login</h3>
    <?php
    /**
     * User not logged in, display the login form.
     * If user has already tried to login, but errors were
     * found, display the total number of errors.
     * If errors occurred, they will be displayed.
     */
    if($form->num_errors 0){
       echo 
    "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
    }
    ?>
    <form action="process.php" method="POST">
    <table align="right" border="1" cellspacing="0" cellpadding="1">
    <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr>
    <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
    <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>>
    <font size="2">Remember me next time &nbsp;&nbsp;&nbsp;&nbsp;
    <input type="hidden" name="sublogin" value="1">
    <input type="submit" value="Login"></td></tr>
    <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
    <tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr>
    </table>
    </form>

    <?php
    }
    /**
     * Just a little page footer, tells how many registered members
     * there are, how many users currently logged in and viewing site,
     * and how many guests viewing site. Active users are displayed,
     * with link to their user information.
     */
    echo "</td></tr><tr><td align=\"center\"><br><br>";

    /**'echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";
    'echo "There are $database->num_active_users registered members and ";
    echo "$database->num_active_guests guests viewing the site.<br><br>";
    */

    include("include/view_active.php");

    ?>
    </td></tr>
    </table>
    </body>
    </html>
    <?php
    include("dinclude/dfooter.php"); 
    ?>

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    It almost looks like php wasn't installed correctly. You do know you can install apache on windows right?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, there may be problems with the Install. Actually I am thinking now that it will be better maybe just to install Apache on Windows. That is what I did before, but I was tempted to just try throwing the files into IIS and seeing if I could get it to work.

    I think I will try installing apache. Thanks again for the help.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    There a few installer packages that can do this for you so you don't have to waste time getting things to work. XAMPP is the installer I use and it works great.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    It almost looks like php wasn't installed correctly. You do know you can install apache on windows right?
    Ok, I downloaded apache and tried installing it on this Windows 2003 computer. The message I get is no socket available. Could not bind 0.0.0.0. Does that mean anything to you?

    Apache is installed in the sense that I see the feather icon in the bottom right corner of the screen. When I click start it just says operation failed.
    Last edited by rock_14; 08-13-2007 at 09:02 PM.

  • #11
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I suggest you use the installer package I mentioned. It will save you the hassle of trying to install apache on your own.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #12
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    I suggest you use the installer package I mentioned. It will save you the hassle of trying to install apache on your own.
    Thanks, but I have a question about this. I read somewhere it shouldn't be used on live production sites. What do I do download it and install it, and then when it works what do I do about the security problems with XAMPP?

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Thats only because out of the box many of its features like mysql, and phpmyadmin have no password set to them. XAMPP allows you to set these under the security settings on the xampp main page (http://localhost/xampp/)

    Good link here you should read. http://www.uhost4free.com/xampp.htm
    Last edited by _Aerospace_Eng_; 08-13-2007 at 09:24 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #14
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Thats only because out of the box many of its features like mysql, and phpmyadmin have no password set to them. XAMPP allows you to set these under the security settings on the xampp main page (http://localhost/xampp/)

    Good link here you should read. http://www.uhost4free.com/xampp.htm
    Thank you for your really excellent help. By the way, do you do consulting work?

  • #15
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Just as a side note when you run Apache make sure you shut down IIS first.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •