PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 13th, 2009, 03:13 PM
Emran_Omar Emran_Omar is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: May 2009
Posts: 2 Emran_Omar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 sec
Reputation Power: 0
Problems with GD library after migration

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

PHP 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$gdHandler0000$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 !!!

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > Problems with GD library after migration


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek