Jump to content

Windows missing something for php


ntburchf

Recommended Posts

Hi,

 

pretty new to windows servers-- long time linux.

 

here's the issue.

I have some php files running on my linux servers. They work perfectly and not recall having to add any extra junk to get these to work

 

as an example. (linux)

http://74.52.137.37/index.php

 

what this script will allow is you to open multi server screenshot dir's that

reside on the local server via a pull down) I'll work on remote later.

 

So, i get 3 new windoz boxes. Install IIS, + php + gd.

But these windows will not display create these images like it does on linux. Trying to figure out what I'm missing on the windows side to get it to work..

here's what it looks like

 

http://75.126.153.188/pbscreen/index.php

 

and the part of the code that's not working

 


// Image Functions
// --------------------------------------------

function qt($w,$h,$t) {
	header("Content-type: image/png");
	$im               = imagecreate($w,$h);
	$background_color = imagecolorallocate($im, 0, 0, 0);
	$text_color       = imagecolorallocate($im, 255, 255, 255);
	imagestring($im, 2, 3, 2,  $t, $text_color);
	imagepng($im);
	imagedestroy($im);
	exit;
}

			imagegammacorrect ( $target_id , 1.0 , 2.0 );
		}
		imagepng($target_id);
		imagedestroy($target_id);
		exit;
	}
	exit;
}
qt(118, 18, "No option selected.");
?>

 

Not sure if my function qt($w,$h,$t) {

works on windows or not.

php is not kicking out any errors...

 

beats me :)

Link to comment
Share on other sites

pfft --

nevermind

 

had my if win bit flipped to false

<?php
   	function FName( $fullpath = "" )
{
	if ( $fullpath == "" )
	{
		$fullpath = $_SERVER['PATH_TRANSLATED'];
	}
	$x = explode( "/" , str_replace("\\", "/", $fullpath ) );
	$name = $x[ ( count($x) - 1 ) ];
	return ($name);
}
function FBasePath( $fullpath = "" )
{
	if ( $fullpath == "" )
	{
		$fullpath = $_SERVER['PATH_TRANSLATED'];
	}
	$x = explode( "/" , str_replace("\\", "/", $fullpath ) );
	unset($x[ ( count($x) - 1 ) ]);
	$name = implode( "/" , $x )."/";
	return ($name);
}
function FFullPath( $fullpath = "" , $force_unix = false )
{
	if ( $fullpath == "" )
	{
		return ($_SERVER['PATH_TRANSLATED']);
	}
	$fullpath = str_replace( "\\" , "/", $fullpath);
	$base = FBasePath( $_SERVER['PATH_TRANSLATED'] );
	$file = FName(     $fullpath                   );
	$path = FBasePath( $fullpath                   );
	$win  = true;
	if ( $force_unix == false && preg_match('/\.exe/i', $_SERVER['COMSPEC'] ) )
	{
		$win = true;
	snip ---------
?>

 

works now :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 3 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use