Webserver ja, lokal nein

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Webserver ja, lokal nein

    Hallo, ich habe mir folgendes Script runtergeladen (es soll Barcodes erzeugen)

    PHP-Code:
    <?php
    $text  
    =  implode($argv"  ");
        
    $barcodeheight=40;
        
    $barcodethinwidth=2;
        
    $barcodethickwidth=$barcodethinwidth*3;
        
    $codingmap  =  Array( "0"=> "000110100""1"=> "100100001",
            
    "2"=> "001100001""3"=> "101100000""4"=> "000110001",
            
    "5"=> "100110000""6"=> "001110000""7"=> "000100101",
            
    "8"=> "100100100""9"=> "001100100""A"=> "100001001",
            
    "B"=> "001001001""C"=> "101001000""D"=> "000011001",
            
    "E"=> "100011000""F"=> "001011000""G"=> "000001101",
            
    "H"=> "100001100""I"=> "001001100""J"=> "000011100",
            
    "K"=> "100000011""L"=> "001000011""M"=> "101000010",
            
    "N"=> "000010011""O"=> "100010010""P"=> "001010010",    
            
    "Q"=> "000000111""R"=> "100000110""S"=> "001000110",
            
    "T"=> "000010110""U"=> "110000001""V"=> "011000001",
            
    "W"=> "111000000""X"=> "010010001""Y"=> "110010000",
            
    "Z"=> "011010000"" "=> "011000100""$"=> "010101000",
            
    "%"=> "000101010""*"=> "010010100""+"=> "010001010",
            
    "-"=> "010000101""."=> "110000100""/"=> "010100010");
        
    $text  =  strtoupper($text);
        
    $text  =  "*$text*";  //  add  start/stop  chars.
        
    $textlen  =  strlen($text);
        
    $barcodewidth  =  ($textlen)*(7*$barcodethinwidth
                                          
    +
    3*$barcodethickwidth)-$barcodethinwidth;
        
    $im  =  ImageCreate($barcodewidth,$barcodeheight);
        
    $black  =  ImageColorAllocate($im,0,0,0);
        
    $white  =  ImageColorAllocate($im,255,255,255);
        
    imagefill($im,0,0,$white);
        
    $xpos=0;
        for  (
    $idx=0;$idx<$textlen;$idx++)  {
            
    $char  =  substr($text,$idx,1);
            
    //  make  unknown  chars  a  '-';
            
    if  (!isset($codingmap[$char]))  $char  =  "-";
            for  (
    $baridx=0;$baridx<=8;$baridx++)  {
                
    $elementwidth  =  (substr($codingmap[$char],$baridx,1))  ?
                                                        
    $barcodethickwidth
    :  $barcodethinwidth;
                if  ((
    $baridx+1)%2)  imagefilledrectangle($im,$xpos,0,$xpos+
                                                       
    $elementwidth-1,$barcodeheight,$black);
                
    $xpos+=$elementwidth;
            }
            
    $xpos+=$barcodethinwidth;
        }
        
    Header"Content-type: image/png");
        
    ImagePng($im);
        
    ImageDestroy($im);
        return;        
    ?>
    Problem: Auf meinem Webserver gehts, lokal (Hab dieses Xampp PAket installiert) gehts nicht. Er kann die Grafik nicht darstellen, kommt immer nur ein rotes Kreuz. Kann es daran liegen, das ic hirgendso eine Grafikbibiliotek nicht habe? Wo bekomme ich die, und wie installiere ich die? Danke!

  • #2
    Deine Vermutung dürfte richtig sein. Es scheint die GD Library zu fehlen. Das kannst Du überprüfen, indem Du phpinfo() aufrufst.

    Hier kannst Du das Ding herunterladen: http://www.boutell.com/gd/

    Kommentar


    • #3
      Oder lade dir den neuen WAMPP von Apache-Friends runter, der hat die GDLib schon mit drin.
      *winks*
      Gilbert
      ------------------------------------------------
      Hilfe für eine Vielzahl von Problemen!!!
      http://www.1st-rootserver.de/

      Kommentar


      • #4
        das kreuz heisst eigentlich das der browser die Datei nicht gefunden hat
        mfg
        marc75

        <Platz für anderes>

        Kommentar


        • #5
          hm, irgendwie komme ich mit dem GD Download nicht klar. hab das ZIP archiv runtergeladen. Und wohon dann damit?

          Kommentar


          • #6
            *verschieb* hat nichts mit PHP zu tun.

            Kommentar


            • #7
              Original geschrieben von Simon6785
              hm, irgendwie komme ich mit dem GD Download nicht klar. hab das ZIP archiv runtergeladen. Und wohon dann damit?
              lies dir noch einmal wotan's post durch ....
              INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


              Kommentar


              • #8
                also ic hhab lange auf apachefriends.org gesucht, aber nur den xampp gefunden keinen wampp...

                also nur den, den ich schon habe

                Kommentar


                • #9
                  XAMPP ist die neue bezeichnung für WAMPP oder LAMPP....W stand für windows, L für linux, und nun nennt man es halt X.

                  Kommentar


                  • #10
                    da gibt es ne windoof- und ne linux-version.

                    und nun darfst du raten, was du laden musst, um @home entsprechend arbeiten/testen zu können.
                    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                    Kommentar


                    • #11
                      also ich hab mal PHPINFO() eingegeben, da steht aber, das GD installierrt ist:

                      GD Support: enabled
                      GDVERSION: bundeled (2.0.23 compatible)

                      und so weiter....

                      aber trotzdem läuft das Script nicht.... Online gehts

                      Kommentar


                      • #12
                        meine Empfehlung:
                        - vergleiche die beiden Ausgaben von phpinfo()
                        - sich nochmals vergewissern, ob man auch die Version im Netz hat
                        - Prüfen, ob man/Scriptausführer auch alle Rechte zur Erstellung von Dateien hat

                        Kommentar


                        • #13
                          Was hast du Online an:
                          PHP
                          GD-Version
                          PNG support

                          Was hast du Offline an:
                          PHP
                          GD-Version
                          PNG support

                          ???

                          Übrings meinte ich den hier: http://www.apachefriends.org/wampp.html
                          *winks*
                          Gilbert
                          ------------------------------------------------
                          Hilfe für eine Vielzahl von Problemen!!!
                          http://www.1st-rootserver.de/

                          Kommentar


                          • #14
                            genau den hab ich...

                            Also:

                            OFFLINE SERVER:

                            GD Support: enabled
                            GD Version: bundeled (2.0.32 compatible)
                            Freetype Support: enabled
                            Freetype linkage: with freetype
                            Freetype Version: 2.1.5
                            GIF Read support: enabled
                            JPG Support: Enabled
                            PNG Support: enabled
                            WBMP Support: enabled
                            XBM Support: enabled


                            ONLINE SERVER:

                            GD Support enabled
                            GD Version bundled (2.0 compatible)
                            FreeType Support enabled
                            FreeType Linkage with freetype
                            T1Lib Support enabled
                            GIF Read Support enabled
                            JPG Support enabled
                            PNG Support enabled
                            WBMP Support enabled

                            was meinst du mit Rechten, Daten zu erstellen. Wo kann ich die denn geben?

                            Kommentar


                            • #15
                              ach, php versionen hatte ich vergessen:

                              OFFLINE: 5.0.0

                              ONLINE: 4.3.1

                              Kommentar

                              Lädt...
                              X