The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Strange GD problem

Discussion in 'General Discussion' started by limneos, Feb 24, 2008.

  1. limneos

    limneos Member

    Joined:
    Mar 21, 2004
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hello to all.
    I'm running a server for some years and I have been using GD perfectly so far on several accounts.
    Suddenly, I wanted to use it in another working account for some image processing.The strange thing is that while in all the previous accounts it works fine and it is still working fine, when I try to use GD on this new account , it doesn't work.
    If I'm not mistaken, GD is a PHP module and since it's running, it's running!
    The functions are all "understood" from PHP (hence it realizes gd is installed) but no image appears whenever I run a php script using GD.
    Instead, I get the error:

    Code:
    Warning: Cannot modify header information - headers already sent by (output started at /home/myaccount/public_html/preview.php:1) in /home/myaccount/public_html/preview.php on line 2
    and the rest of the page is garbled, since it cannot process the
    Code:
    header("Content-type: image/jpeg");
    line.

    The strange thing is that I get the error on line 1 (preview.php:1) but this line is the script starting line. like the error comes from somewhere outside and before the script.

    there are no white spaces above or below the php tags , and these are the exact same files that I use on another account, same code, same images , everything, only on this account it doesn't work! How can this be? Any help appreciated.
     
  2. limneos

    limneos Member

    Joined:
    Mar 21, 2004
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    ok , it seems I solved my own problem, but I want to alert everyone.

    The problem was caused because I was using the new Microsoft's web editor that took the place of Frontpage in Office 2007 called Expression Web.

    This program very smartly adds a few garbled characters : "ο»Ώ" at the beginning (!) of the script so it looks like :

    Code:
    ο»Ώ<? 
    echo "this is php page messed up by ms"
    ?>
    but YOU CANNOT see it in the editor, it's hidden in some file encoding. I could only see the messy characters by opening the php file using nano through my server's ssh login.

    So be aware, since this program is going to replace Frontpage , many web editors will have the same problem. Of course it occurs only in such pages where headers shouldn't be sent and it's rare, but still it's gonna be a lot of pain...

    Regards,

    Limneos
     
Loading...

Share This Page