Previous Next

Thread: PHP not interpreted : PHP5 CGI / IIS7.0 / VISTA SP1 64 bits / FastCGI - blank page

Last post 06-14-2008 4:45 PM by CrazyMerlin. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 05-15-2008, 10:38 AM

    • tdldp
    • Not Ranked
    • Joined on 02-01-2008, 6:26 AM
    • Posts 6

    PHP not interpreted : PHP5 CGI / IIS7.0 / VISTA SP1 64 bits / FastCGI - blank page

    Hello

     I have a major problem with php install...

    After switching to Vista SP1, reinstalling IIS 7 server with FastCGI module running, reinstalling php5 (which works, c:\PHP\php -info returns me answers) under CGI, i get the following problem.. 

    an index.php containing : <?php phpinfo(); ?>

    returns a blank page, but contains inside source page the php code :
    <?php phpinfo(); ?>

    There is no error message, nothing to treat for errors, so how do i solve this ... ???

     thks for your answer

     Tdldp

  • 05-15-2008, 11:07 AM In reply to

    • rlucero
    • Top 25 Contributor
    • Joined on 09-29-2006, 3:35 PM
    • Seattle, WA
    • Posts 114

    Re: PHP not interpreted : PHP5 / IIS7.0 / VISTA SP1 64 bits - blank page

    I would recommend trying some of the steps found here:

    http://3dohio.com/?p=14

    Also, look at the event viewer to see if there are any errors logged.

  • 05-15-2008, 11:25 AM In reply to

    • tdldp
    • Not Ranked
    • Joined on 02-01-2008, 6:26 AM
    • Posts 6

    Re: PHP not interpreted : PHP5 / IIS7.0 / VISTA SP1 64 bits - blank page

    Sorry but this has been followed, and still no success...

    I must precise and i will edit first post, i use FastCGI with php-cgi.exe

     all php code is passed as text...

     phpmyadmin, gives this as answer page :

    urldecode the db name if (isset($lightm_db)) { // no longer urlencoded because of html entities in the db name // $db = urldecode($lightm_db); $db = $lightm_db; unset($lightm_db); } $url_query = PMA_generate_common_url(isset($db) ? $db : ''); header('Content-Type: text/html; charset=' . $GLOBALS['charset']); require_once('./libraries/relation.lib.php'); $cfgRelation = PMA_getRelationsParam(); if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) { PMA_purgeHistory($cfg['Server']['user']); } $phpmain_hash = md5($cfg['PmaAbsoluteUri']); $phpmain_hash_js = time(); ?> &js_frame=right" type=text/css rel=stylesheet>0) { PMA_availableDatabases(); // this function is defined in "common.lib.php" } else { $num_dbs = 0; } if ($num_dbs > 1) { if ($cfg['LeftFrameLight']) { $query_frame_height += 20; } } if ($cfg['QueryFrame']) { /* Will we show list of servers? */ if ($cfg['LeftDisplayServers'] && $cfg['DisplayServersList'] && count($cfg['Servers']) > 1) { $query_frame_height += (count($cfg['Servers']) + 1)*15; } if ($cfg['QueryFrameJS']) { echo ' ' . "\n"; echo '\');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\'

    ' . str_replace("'", "\'", $strNoFrames) . '

    \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\' \');' . "\n"; echo ' document.writeln(\'\');' . "\n"; echo '//-->' . "\n"; echo ' ' . "\n"; echo "\n"; echo '

     and in source :

    <?php
    /* $Id: index.php,v 2.14 2004/10/19 17:23:09 nijel Exp $ */
    // vim: expandtab sw=4 ts=4 sts=4:

    /**
     * Gets core libraries and defines some variables
     */
    require_once('./libraries/grab_globals.lib.php');
    require_once('./libraries/common.lib.php');
    /**
     * Includes the ThemeManager if it hasn't been included yet
     */
    require_once('./libraries/select_theme.lib.php');

    /**
     * Saves collation_connection (coming from main.php) in a cookie
     */

    // (from grab_globals)
    if (isset($collation_connection)) {
        if (!isset($pma_uri_parts)) {
            $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
            $cookie_path   = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
            $is_https      = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0;
        }
        setcookie('pma_collation_connection', $collation_connection, time() + 60*60*24*30, $cookie_path, '', $is_https);
    }
    // Gets the default font sizes
    PMA_setFontSizes();

    // Gets the host name
    // loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
    if (empty($HTTP_HOST)) {
        if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
            $HTTP_HOST = $_ENV['HTTP_HOST'];
        }
        else if (@getenv('HTTP_HOST')) {
            $HTTP_HOST = getenv('HTTP_HOST');
        }
        else {
            $HTTP_HOST = '';
        }
    }
    /**
     * Defines the frameset
     */
    // loic1: If left light mode -> urldecode the db name
    if (isset($lightm_db)) {
    // no longer urlencoded because of html entities in the db name
    //    $db    = urldecode($lightm_db);
        $db    = $lightm_db;
        unset($lightm_db);
    }
    $url_query = PMA_generate_common_url(isset($db) ? $db : '');
    header('Content-Type: text/html; charset=' . $GLOBALS['charset']);

    require_once('./libraries/relation.lib.php');
    $cfgRelation = PMA_getRelationsParam();

    if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
        PMA_purgeHistory($cfg['Server']['user']);
    }

    $phpmain_hash = md5($cfg['PmaAbsoluteUri']);
    $phpmain_hash_js = time();
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
    <head>
    <title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
    <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&amp;js_frame=right" />
    </head>

    <?php
    $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_left.png';
    $query_frame_height = 0;
    if ($cfg['LeftDisplayLogo'] && @file_exists($logo_image)) {
        $tmp_imgsize = @getimagesize($logo_image);
        $query_frame_height = ($tmp_imgsize[1] + 60);
        // increase the height to take into account font size differences in
        // theme 'original'? (TODO: improve with a parameter in layout.inc.php)
        $query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 25 : 0);
    }
    if ($query_frame_height == 0) {
        $query_frame_height = 60;
    }
    // increase the height to take into account font size differences in
    // theme 'original'? (TODO: improve with a parameter in layout.inc.php)
    $query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 20 : 10);

    if ($cfg['LeftDisplayServers'] && !$cfg['DisplayServersList']) {
        $query_frame_height += 40;
    }
    if ($server > 0) {
        PMA_availableDatabases(); // this function is defined in "common.lib.php"
    } else {
        $num_dbs = 0;
    }
    if ($num_dbs > 1) {
        if ($cfg['LeftFrameLight']) {
            $query_frame_height += 20;
        }
    }
    if ($cfg['QueryFrame']) {
        /* Will we show list of servers? */
        if ($cfg['LeftDisplayServers'] && $cfg['DisplayServersList'] && count($cfg['Servers']) > 1) {
            $query_frame_height += (count($cfg['Servers']) + 1)*15;
        }

        if ($cfg['QueryFrameJS']) {
            echo '<script type="text/javascript">' . "\n";
            echo '<!--' . "\n";
            echo '    document.writeln(\'<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="1" name="mainFrameset" id="mainFrameset">\');' . "\n";
            echo '    document.writeln(\'    <frameset rows="' . $query_frame_height . ', *" framespacing="0" frameborder="0" border="0" name="leftFrameset" id="leftFrameset">\');' . "\n";
            echo '    document.writeln(\'        <frame src="queryframe.php?' . $url_query . '&amp;hash=' . $phpmain_hash . $phpmain_hash_js . '" name="queryframe" frameborder="0" scrolling="no" id="leftQueryframe" />\');' . "\n";
            echo '    document.writeln(\'        <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . $phpmain_hash_js . '" name="nav" frameborder="0" id="leftFrame" />\');' . "\n";
            echo '    document.writeln(\'    </frameset>\');' . "\n";
            echo '    document.writeln(\'    <frame src="' . (empty($db) ? $cfg['DefaultTabServer']  : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . $phpmain_hash_js . '" border="0" frameborder="0" style="border-left: 1px solid #000000;" id="rightFrame" />\');' . "\n";
            echo '    document.writeln(\'    <noframes>\');' . "\n";
            echo '    document.writeln(\'        <body bgcolor="#FFFFFF">\');' . "\n";
            echo '    document.writeln(\'            <p>' . str_replace("'", "\'", $strNoFrames) . '</p>\');' . "\n";
            echo '    document.writeln(\'        </body>\');' . "\n";
            echo '    document.writeln(\'    </noframes>\');' . "\n";
            echo '    document.writeln(\'</frameset>\');' . "\n";
            echo '//-->' . "\n";
            echo '</script>' . "\n";
            echo "\n";
            echo '<noscript>' . "\n";
        }

        echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*"  border="1" frameborder="1" framespacing="1" name="mainFrameset" id="mainFrameset">' . "\n";
        echo '    <frameset rows="' . $query_frame_height . ', *" framespacing="0" frameborder="0" border="0" name="leftFrameset" id="leftFrameset">' . "\n";
        echo '        <frame src="queryframe.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="queryframe" frameborder="0" scrolling="no" id="leftQueryframe" />' . "\n";
        echo '        <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="nav" frameborder="0" id="leftFrame" />' . "\n";
        echo '    </frameset>' . "\n";
        echo '    <frame src="' . (empty($db) ? $cfg['DefaultTabServer']  : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" frameborder="0" id="rightFrame" />' . "\n";

    } else {

        echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="1" id="leftFrameset" >' . "\n";
        echo '    <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="nav" frameborder="0" id="leftFrame" />' . "\n";
        echo '    <frame src="' . (empty($db) ? $cfg['DefaultTabServer']  : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" id="rightFrame" frameborder="1" />' . "\n";

    }
    ?>

        <noframes>
            <body bgcolor="#FFFFFF">
                <p><?php echo $strNoFrames; ?></p>
            </body>
        </noframes>
    </frameset>
    <?php
    if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
        echo '</noscript>' . "\n";
    }
    ?>

    </html>

  • 05-15-2008, 1:55 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 3:38 PM
    • Redmond, WA
    • Posts 154

    Re: PHP not interpreted : PHP5 / IIS7.0 / VISTA SP1 64 bits - blank page

    This may happen when static file handler serves the php pages instead of fastcgi handler. In IIS manager go to "Handler mappings" for your web site and then in the "Actions" pane on right hand site click on "View Ordered List". Check if the FastCGI handler mapping for *.php is before the StaticFile handler mapping.

    http://ruslany.net
    Tags:
  • 05-15-2008, 4:54 PM In reply to

    • tdldp
    • Not Ranked
    • Joined on 02-01-2008, 6:26 AM
    • Posts 6

    Re: PHP not interpreted : PHP5 / IIS7.0 / VISTA SP1 64 bits - blank page

    Ok checked what you said, and saw for first time since installation that php module was at state deactivated instead of active... thought it was a fastCGI problem, so went to uninstall iis totally, and reinstall it...

     Once done and rebooted, i have the module FastCgi natively installed, but when trying to map script, i do not have anymore "Fastcgi Module" dropbox...

    What's up now ???

    EDITED :  After rebooting IIS, fastcgi module is correctly reinstalled...
    Configured correctly with php, and mime type set to .php   (text/html) 
    i still get that darn blank  page and code not executed...

    IIS7 is driving me nuts... 

     

    tdldp

  • 05-18-2008, 5:56 PM In reply to

    Re: PHP not interpreted : PHP5 / IIS7.0 / VISTA SP1 64 bits - blank page

     Have you tied configuring IIS to use PHP in ISAPI or regular CGI mode? Are you seeing any sort of HTTP error code? Are any errors showing in your IIS log files?

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 06-14-2008, 4:45 PM In reply to

    Re: PHP not interpreted : PHP5 / IIS7.0 / VISTA SP1 64 bits - blank page

    lol....having same issue here too, same setup except I'm running WS2008 w/IIS7

    Order list has PHP via FastCGI as first option with path of *.php.

    I got a blank page but when viewing source I see my php as uninterpreted script.

    So I thought I'd try something....I use short-tags by default <? ?> so I thought I'd try long tags <?php ?> ...et viola! I now have interpreted script.

     
    Hope that is your issue too and simply solved.

    If you wish to use short tags, you'll need to enable them in php.ini

    Paul 

Page 1 of 1 (7 items)
Page view counter