Seite 1 von 1

png bei 1und1 Managed Server

Verfasst: 02.11.2006, 13:39
von workershop
Hallo

Ich habe ein neues Projekt, in dem ein Grafischer Sicherheitscode auf ein png geschrieben werden soll. Es wird jedoch der Code nicht angezeigt. In einen anderen Script funktioniert so etwas in der Art bei einem Gif.

Das Script kann auch nicht kaputt sein, weil es hier auch funktioniert(das gleiche wie unseres) https://www.ostseeinsel.eu/data/grafisc ... 02%209%20Q

Wir haben einen Managed Server bei 1und1. Kann es sein, das es a Server liegt, das er kein PNG Anzeigen kann?

So wird der Code erzeugt: <?php

$Grafik=imagecreatefrompng("hintergrund.png");
$Rahmenmass=imagettfbbox(20, 0, "mistral.ttf", $_REQUEST['Code']);
$Rahmenmass[5]*=-1;
$TextBreite=(200-$Rahmenmass[2])/2;
$TextHoehe=((50-$Rahmenmass[5])+($Rahmenmass[5]*2))/2;

$Textfarbe = imagecolorallocate($Grafik, 128, 128, 128);
imagettftext($Grafik, 20, 0, $TextBreite, $TextHoehe, $Textfarbe, "mistral.ttf", $_REQUEST['Code']);
imagepng($Grafik);

?>


Danke Ronny

Verfasst:
von

Re: png bei 1und1 Managed Server

Verfasst: 02.11.2006, 15:40
von Alpinist
workershop hat geschrieben:Kann es sein, das es a Server liegt, das er kein PNG Anzeigen kann?
Ja. Schau mal mithilfe der phpinfo() ob folgendes installiert ist:
Anmerkung: ACHTUNG: Die PNG-Unterstützung ersetzt die GIF-Funktionen ab der GD-Bibliothek Version 1.6. Diese Funktion ist also nur verfügbar, wenn Sie eine Version ab 1.6 verwenden.
aus https://de.php.net/imagepng

Grüße

Verfasst: 02.11.2006, 15:50
von workershop
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled



Eigentlich unterstützt er es ja.

Verfasst:
von

Re: png bei 1und1 Managed Server

Verfasst: 02.11.2006, 15:55
von Alpinist
workershop hat geschrieben:Es wird jedoch der Code nicht angezeigt.
Also es wird eine Bild erzeugt, nur ohne den Code, ist das richtig?
Ich tippe darauf, dass die Schriftart auf dem Server nicht installiert ist, versuchs doch mal mit einer Standardschriftart (z.B. "ARIAL.TTF" oder "TAHOMA.TTF" für einen Windows Server)...

Grüße

Verfasst: 02.11.2006, 16:32
von workershop
Ja, das Bild wird erzeugt nur ihne Schrift. Die Schrift liegt im gleichen Verzeichnis wie die Abfrage, so wie es sein soll.

Verfasst: 02.11.2006, 16:37
von Alpinist
workershop hat geschrieben:Ja, das Bild wird erzeugt nur ihne Schrift. Die Schrift liegt im gleichen Verzeichnis wie die Abfrage, so wie es sein soll.
Und das Skript wird nicht zufällig aus einen anderen Verzeichnis mit include() aufgerufen? Wenn ja, muss die Fontdatei in das Aufrufende Verzeichnis, nicht das des obigen Skriptes.

Beispiel:
/abc/pnggenerator.php
/xyz/aufrufendesSkript.php

dann muss die Fontdatei in /xyz/ und nicht /abc/ gespeichert werden.

Ich hoffe, ich konnte helfen.

Grüße

Verfasst: 02.11.2006, 16:45
von workershop
Nein, die Datei wo es aufgerufen wird, ist das gleiche Verzeichnis.

Verfasst: 02.11.2006, 16:51
von Alpinist
Nachdem ich auf die schnelle nicht einsehen kann, ob Du ein Unix/Linux oder Windows Server hast: ist der Name der Datei "mistral.ttf" richtig geschrieben (Groß-/Kleinschreibung)?
Wäre aber nur wichtige wenns ein Unix/Linux System ist...

Grüße

Verfasst: 02.11.2006, 17:01
von workershop
Die ist kleingeschrieben. Es ist ein normaler 1und1 Managed Server

Verfasst: 02.11.2006, 17:10
von Alpinist
workershop hat geschrieben:Es ist ein normaler 1und1 Managed Server
Wird wohl ein Linuxderivat sein.

Ich kann Dir jetzt aber auch nicht weiterhelfen, Du solltest es aber trotzdem mal mit einer Standard- bzw. anderen Schriftart versuchen. Evtl. kommt Dein Server nicht mit dem Dateiformat klar.

Grüße

Verfasst: 02.11.2006, 18:31
von 800XE
workershop hat geschrieben:Ja, das Bild wird erzeugt nur ihne Schrift. Die Schrift liegt im gleichen Verzeichnis wie die Abfrage, so wie es sein soll.
also, das Bild wird erzeugt ......
... vielleicht ist der Font ja doch nicht im Richtigen Verzeichniss ...

häng das ganze mal in einen if Block

Code: Alles auswählen

if &#40; file_exists&#40; 'mistral.ttf' &#41;&#41; 
&#123;
  createfrompng
  .
  .
  .
  .
  imagepng
&#125;
wird das Bild immernoch erzeugt, ist der Font auch dort wo er sein muß

FreeType Support enabled
FreeType Linkage with freetype
is FreeType == TrueType ???

oder kanns vielleicht sein das der Server kein TrueType unterstüzt?

Verfasst: 03.11.2006, 10:24
von workershop
Die Schrift ist im richtigen Verzeichnis. Ich habe es mal mit Arial versucht, aber da funktioniert es auch nicht. Unten noch mal meine PHP Info. Ich habe von Server null Ahnung. Die Zahl wird auch erzeugt, bloß eben nicht auf das Bild geschrieben.



System Linux infong 2.4 #1 SMP Thu Jan 13 08:59:31 CET 2005 i686 unknown
Build Date Aug 29 2006 14:05:37
Configure Command '../configure' '--with-pear' '--with-mysql=/usr' '--with-zlib' '--enable-debug=no' '--enable-safe-mode=no' '--enable-discard-path=no' '--with-gd=/usr' '--with-png-dir=/usr/lib' '--enable-track-vars' '--with-db' '--with-gdbm' '--enable-force-cgi-redirect' '--with-ttf=/usr/' '--enable-ftp' '--with-mcrypt' '--enable-dbase' '--enable-memory-limit' '--enable-calendar' '--enable-wddx' '--with-jpeg-dir=/usr/src/kundenserver/jpeg-6b' '--enable-bcmath' '--enable-gd-imgstrttf' '--enable-shmop' '--enable-mhash' '--with-mhash=/usr/src/kundenserver/mhash-0.8.9/' '--with-openssl' '--enable-xslt' '--with-xslt-sablot' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-imap' '--with-curl' '--with-iconv=/usr/local' '--with-freetype-dir=/usr/include/freetype2' '--with-bz2' '--with-gettext' '--enable-exif' '--with-idn' '--enable-mbstring=all'
Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety disabled
Registered PHP Streams php, http, ftp, https, ftps, compress.bzip2, compress.zlib

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


--------------------------------------------------------------------------------

PHP Credits

--------------------------------------------------------------------------------

Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen On On
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_prepend_file no value no value
browscap /usr/local/lib/browscap.ini /usr/local/lib/browscap.ini
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 2037 2037
expose_php On On
extension_dir /usr/local/lib/php/extensions/no-debug-non-zts-20020429 /usr/local/lib/php/extensions/no-debug-non-zts-20020429
file_uploads On On
gpc_order GPC GPC
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/local/lib/php .:/usr/local/lib/php
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
max_execution_time 50000 50000
max_input_time -1 -1
memory_limit 40M 40M
open_basedir no value no value
output_buffering 0 0
output_handler no value no value
post_max_size 8M 8M
precision 14 14
register_argc_argv On On
register_globals On On
report_memleaks On On
safe_mode Off Off
safe_mode_exec_dir /usr/local/php/bin /usr/local/php/bin
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 20M 20M
upload_tmp_dir no value no value
user_dir no value no value
variables_order no value no value
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On


bcmath
BCMath support enabled


bz2
BZip2 Support Enabled
BZip2 Version 1.0.2, 30-Dec-2001


calendar
Calendar support enabled


ctype
ctype functions enabled


curl
CURL support enabled
CURL Information libcurl/7.10.3 OpenSSL/0.9.6g ipv6 zlib/1.2.1


db
This is GDBM version 1.7.3, as of May 19, 1994.


dba
DBA support enabled
Supported handlers gdbm cdb cdb_make inifile flatfile


domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20609
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.0.33
libxslt compiled against libxml Version 2.6.2
DOM/EXSLT enabled
libexslt Version 1.0.33


exif
EXIF Support enabled
EXIF Version 1.4 $Id: exif.c,v 1.118.2.37.2.4 2006/01/01 13:46:52 sniper Exp $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF


ftp
FTP support enabled


gd
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled


gettext
GetText Support enabled


iconv
iconv support enabled
iconv implementation libiconv
iconv library version 1.8

Directive Local Value Master Value
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1


idn
IDN support enabled
RCS Version $Id: idn.c,v 0.31 2004/12/18 15:38:43 turbo Exp $
LibIDN version 0.4.1

Directive Local Value Master Value
idn.allow_unassigned_chars 0 0
idn.default_charset ISO-8859-1 ISO-8859-1
idn.use_std_3_ascii_rules 0 0


imap
IMAP c-Client Version 2001


mbstring
Multibyte Support enabled
Japanese support enabled
Simplified chinese support enabled
Traditional chinese support enabled
Korean support enabled
Russian support enabled
Multibyte (japanese) regex support enabled

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Directive Local Value Master Value
mbstring.detect_order no value no value
mbstring.encoding_translation Off Off
mbstring.func_overload 0 0
mbstring.http_input pass pass
mbstring.http_output pass pass
mbstring.internal_encoding ISO-8859-1 no value
mbstring.language neutral neutral
mbstring.substitute_character no value no value


mcrypt
mcrypt support enabled
version >= 2.4.x
Supported ciphers twofish rijndael-128 rijndael-192 rijndael-256 saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97 gost threeway cast-128 blowfish des blowfish-compat tripledes enigma arcfour panama wake
Supported modes ofb cfb nofb cbc ecb stream ncfb ctr

Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value


mhash
MHASH support Enabled
MHASH API Version 20011020


mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 4.0.25
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off


openssl
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.6g 9 Aug 2002


overload
User-Space Object Overloading Support enabled


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 6.6 06-Feb-2006


posix
Revision $Revision: 1.51.2.4.2.1 $


session
Session Support enabled
Registered save handlers files user

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off


shmop
shmop support enabled


standard
Regex Library Bundled library enabled
Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i

Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 60 60
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags a=href,area=href,frame=src,form=fakeentry,fieldset= a=href,area=href,frame=src,form=fakeentry,fieldset=
user_agent no value no value


tokenizer
Tokenizer Support enabled


wddx
WDDX Support enabled
WDDX Session Serializer enabled


xml
XML Support active
XML Namespace Support active
EXPAT Version 1.95.6


xslt
XSLT support enabled
Backend Sablotron
Sablotron Version 1.0
Sablotron Information Cflags: -lstdc++ -O2 -D_REENTRANT Libs: -L/usr/lib -lexpat Prefix: /usr


zlib
ZLib Support enabled
Compiled Version 1.2.1
Linked Version 1.2.1

Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value


Additional Modules
Module Name
dbase

Verfasst: 04.11.2006, 11:00
von workershop
Ich habe es jetzt mal so probiert und es ändert sich nichts.

<?php

$Grafik=imagecreatefrompng("hintergrund.png");
$Rahmenmass=imagettfbbox(20, 0, "https://www.blabla.de/data/mistral.ttf", $_REQUEST['Code']);
$Rahmenmass[5]*=-1;
$TextBreite=(130-$Rahmenmass[2])/2;
$TextHoehe=((45-$Rahmenmass[5])+($Rahmenmass[5]*2))/2;

$Textfarbe = imagecolorallocate($Grafik, 128, 128, 128);
imagettftext($Grafik, 20, 0, $TextBreite, $TextHoehe, $Textfarbe, "https://www.blabla.de/data/mistral.ttf", $_REQUEST['Code']);
imagepng($Grafik);

?>

Verfasst: 06.11.2006, 13:44
von workershop
edvsb hat geschrieben:Hi,

ist sagte ja auch absoluter Server-Pfad, also in etwa so
/var/www/vhosts/ferien-netzwerk.de/httpdocs/test/mistral.ttf

Genau das war es. Jetzt geht es. Danke Dir noch mal für die Hilfe.