hi everybody,
i get a funny and very big problem !!!
i was running my explication in a web server (LINUX) and after this i´m running it in a new server (windows 2008 64bits).
the big problem i get is, i have the same MySQL server, the same data, the same PHP server, the same script, but the only difference is my OS.
here is the phpinfo from the new server:
im[dot]intercultural[dot]com[dot]br/im/phpinfo.php
here is the phpinfo from the old server
[dot]intercultural[dot]com[dot]br/dev/phpinfo.php
here the script running in the new server:
im[dot]intercultural[dot]com[dot]br/im/clientes/mostraFoto.php?sessionid=&id_foto_pais=97&tamanho=150
here the script running in the old server:
intercultural[dot]com[dot]br/im/clientes/mostraFoto.php?sessionid=&id_foto_pais=97&tamanho=150
and here is the code
<?
$path = "../";
include_once ($path."includes/config.inc.php");
include_once ($path."includes/db_generico.inc.php");
include_once($path."includes/utils.inc.php");
// Variáveis passadas por POST/GET
$sIdFotoPais = $_REQUEST['id_foto_pais'];
$sIdFotoCidade = $_REQUEST['id_foto_cidade'];
$sIdFotoEscola = $_REQUEST['id_foto_escola'];
$sIdFotoHigh = $_REQUEST['id_foto_high'];
$sIdFotoEscolaFerias = $_REQUEST['id_foto_escola_ferias'];
$conexao = bd_conecta($config["db"]);
if ( $sIdFotoPais != "" ) {
$sQuery = "select arquivo,arquivo_tipo,arquivo_tamanho,arquivo_nome from inter_imagens_paises where id_imagem='$sIdFotoPais'";
}
else if ( $sIdFotoCidade != "" ) {
$sQuery = "select arquivo,arquivo_tipo,arquivo_tamanho,arquivo_nome from inter_imagens_cidades where id_imagem='$sIdFotoCidade'";
}
else if ( $sIdFotoEscola != "" ) {
$sQuery = "select arquivo,arquivo_tipo,arquivo_tamanho,arquivo_nome from inter_imagens_escolas where id_imagem='$sIdFotoEscola'";
}
else if($sIdFotoHigh > 0){
$sQuery = "select arquivo,arquivo_tipo,arquivo_tamanho,arquivo_nome from inter_imagens_high where id_imagem='$sIdFotoHigh'";
}
else if($sIdFotoEscolaFerias > 0){
$sQuery = "select arquivo,arquivo_tipo,arquivo_tamanho,arquivo_nome from inter_imagens_escolas_ferias where id_imagem='$sIdFotoEscolaFerias'";
}
if ($rs = bd_executaQuery($conexao,$sQuery,$config["db"])) {
$linha = bd_array($rs);
$sArquivo = $linha["arquivo"];
$sTipo = $linha["arquivo_tipo"];
$sTamanho = $linha["arquivo_tamanho"];
$sNomeArquivo = $linha["arquivo_nome"];
}
bd_desconecta($conexao);
// redimensiona para o tamanho informado
$binary = $sArquivo;
$gdHandler = imagecreatefromstring($binary);
$width = imagesx($gdHandler);
$height = imagesy($gdHandler);
if ($width > $height) {
if ($width > $tamanho) {
$ratio = $tamanho / $width;
} else {
$ratio = 1;
}
} else {
if ($height > $tamanho) {
$ratio = $tamanho / $height;
} else {
$ratio = 1;
}
}
$newWidth = round($tamanho);
$newHeight = round($height * $ratio);
$newGdHandler = imagecreatetruecolor($newWidth, $newHeight);
imagecopyresampled($newGdHandler, $gdHandler, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
header("Content-Type:".$sTipo);
imagejpeg($gdHandler, '', 60);
?>
i already try to get the data from the old DB server (MySQL) and run it in the new server, but it did not work, i try the other wise, get the data from the new DB server (MySQL) and run it in the old server and it work, so i believe the problem is not in the MYSQL codification or something like that but is with the PHP server.
other difference is, i was running apache in the old server and now running IIS 7
so please, any one can gave me any help ? i had tried almost everything i found in the internet and didn´t succeed, i´m dealing with this problem since last week and i dont know what else i can do to fix it.
tks a lot !!!