DigitalJedi805
DigitalJedi805

Reputation: 1460

PHP Memory Shortage? Or?

I've got a web server running IIS7 and I just updated to PHP 5.3. I have two sites that seem to run fine, and they both use some small degree of PHP. The revision I am currently testing on this server, presumably uses much... much more.

The problem I am encountering is that on my testing server ( a local XAMPP installation ), my page loads fine. When I push this to my server and hit the page in my browser, I get the following:

Id ) return true; } return false; } public static function PrintSelector($SelectionArray) { if( !isset($SelectionArray)) { Page::WriteLine("
No selections are available.

"); } else { $FoundViewer = false; foreach($SelectionArray as $Selection) { if( $Selection->IsViewing()) { $ViewerSelection = $Selection; $FoundViewer = true; } } if( $FoundViewer ) { Page::WriteLine("Show / Hide " . get_class($Selection) . " Selections"); $ViewerSelection->PrintOverview(); Page::WriteLine("
"); } Page::WriteLine("\n"); foreach($SelectionArray as $Selection) if( $Selection->IsSelectable() && !$Selection->IsViewing()) $Selection->PrintSelection(); Page::WriteLine("
\n"); if( $FoundViewer ) Page::WriteLine("
"); } } } ?>

Which is just a bit of the underlying code for my new site.

Upon further investigation, I run down to one of my other sites and get this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>AGP Credential Manager</title>

<link rel="stylesheet" href="styles.css" type="text/css" />

<script type="text/javascript">

function submitPageForm()

{

  document.forms["pageForm"].submit();

}



function submitForm(formName)

{

  document.forms[formName].submit();

}

</script>



<script language="javascript">

  function toggleDiv(divid){

    if(document.getElementById(divid).style.display == 'none'){

      document.getElementById(divid).style.display = 'block';

    }else{

      document.getElementById(divid).style.display = 'none';

    }

  }

</script></head>

<body>

<div id="wrap">

    <div class="header">

        <!-- TITLE -->

        <h1><a href="#">AGP Credential Manager</a></h1>

        <!-- END TITLE -->

    </div>

    <div id="nav">

        <ul>    

            <!-- MENU -->

In the source code. And as I'm sure you can presume, not much for my front-end. It seems as if the PHP starts executing, but fails some couple hundred lines in... for no apparent reason.

Curious if anyone has seen this before and happens to know the fix? Would be great. Thanks.

Upvotes: 2

Views: 166

Answers (2)

drew010
drew010

Reputation: 69977

I suspect the issue may be that your PHP script uses short tags <? but the PHP configuration is such that it does not accept short tags and wants full tags <?php.

You can either change php.ini and set short_open_tag to 1 or modify the scripts to use the full open tag. I would recommend using the full open tag as the short tags have problems with XML files with PHP extensions.

You will also want to check for short echo's, <?= and replace those with <?php echo.

Some regex you may try:

/<?([^p])/<?php$1/g
/<?= /<?php echo /g

Upvotes: 1

fmalina
fmalina

Reputation: 6310

IIS and Apache are two different beasts. For you own sanity, strive to keep your development environment close to your deployment environment.

Upvotes: 2

Related Questions