Installationsanleitungen

 

Hinweis: Diese PHP-Version wird aufgrund diverser Sicherheitslücken von Hostsharing nicht mehr unterstützt. Es empfiehlt sich die Installation der aktuellen bei Hostsharing verfügbaren PHP-Version

 PHP Version 4.3.6

PHP in Version 4.3.6 steht unter /usr/local/share/php/4.3.6 bereit. Unter bin finden sich die Binaries php4 und php, sowie diverse Dienstprogramme, die normalerweise nicht benötigt werden.

php4 ist die CGI Version, bei php handelt es sich um die CLI Version. php ist NUR für Kommandozeilenscripts geeignet und kann NICHT mit Apache benutzt werden.

Unter mod_php liegt das Modul libphp4.so für Apache und kann von GenossInnen mit eigener httpd.conf benutzt werden.

 

Pfade

Nachladbare Extensions, (extesnion_dir) liegen unter /usr/local/share/php/4.3.6/lib/php/20020429

Ini-Dateien unter /usr/local/share/php/4.3.6/etc/. Dabei gibt es pro SAPI eine eigene ini-Datei, die sich am Namen unschwer erkennen lässt. php-apache.ini ist für das Apachemodul, php-cgi.ini für die Verwendung von php über CGI mit Apache und php-cli.ini ist für CLI (Command Line Interface). Weitere Information zu PHP auf der Kommondozeile.

PEAR liegt unter /usr/local/share/php/4.3.6/share/pear und ist im include_path und safe_mode_include_dir enthalten.

Die Einstellungen in den ini-Dateien entsprechen der jetzigen Konfiguration bei Hostsharing, ausgenommen davon natürlichabhängige Pfadangaben.

 

Einkompilierte Extensions

 

  • bcmath
  • bz2
  • calendar
  • ctype
  • dba
  • exif
  • filepro
  • ftp
  • gettext
  • iconv
  • mbstring
  • mcal
  • overload *
  • pcre
  • posix
  • session
  • shmop
  • sockets
  • standard
  • sysvsem
  • sysvshm
  • tokenizer *
  • wddx
  • xml
  • yp
  • zlib

* overload und tokenizer sind neu verfügbare Standardkomponenten von PHP.

 

Nachladbare Extensions

 

  • curl.so
  • domxml.so
  • gd.so
  • imap.so
  • mcal.so *
  • mhash.so
  • ming.so
  • mysql.so
  • odbc.so
  • pgsql.so
  • xslt.so

 

Unterschiede mod_php versus CLI/CGI

Unter mod_php stehen alle oben genannten Extensions zur Verfügung, bei CLI/CGI ist mcal* in der entsprechenden ini-Datei eingetragen.

In php-apache.ini ist der safe_mode aktiviert, bei CGI/CLI nicht.

 

Benutzung der CGI Version mit Apache

Für CGI liegt unter /usr/local/bin/ der wrapper php436stub, der in das cgi-bin Verzeichnis der eigenen Domain kopiert werden muss (~/doms/DOMAIN.TLD/cgi), die passende ini-Datei ist php-cgi.ini, die ebenfalls kopiert werden sollte (s.o.). Hinweis: php436stub liest php-cgi.ini als erste Datei, auch wenn am gleichen Ort noch eine php.ini liegt. Damit lassen sich in unterschiedlichen Verzeichnissen php-4.1.2 und php-4.3.6 nutzen.

Eine .htaccess Datei mit folgendem Inhalt in einem Domainverzeichnis (~/doms/DOMAIN.TLD/subs/) anlegen:

AddType application/x-httpd-phpcgi .php

Action application/x-httpd-phpcgi /cgi-bin/php436stub

Benutzung libphp4.so mit eigener httpd.conf

Als Paketadmin in ~/etc/http/httpd.conf das Apachemodul für php-4.3.6 aktivieren:

LoadModule php4_module /usr/local/share/php/4.3.6/mod_php/libphp4.so

Über Einträge in ~/etc/httpd/xyz00.conf lassen sich Einstellungen für mod_php über die Anweisungen php_admin_flag, php_admin_value, php_flag und php_value an die eigenen Bedürfnisse anpassen. Weiteregehende Informationen zu diesen Anweisungen finden sich im PHP-Manual.

Hinweis: Webserver mittels rc httpd stop und rchttpd start neu starten und darauf achten, dass kein altes PHP Modulmehr geladen ist.

 

Unterschiede zu php-4.1.2

Seit php-4.3.0 stehen aus Sicherheitsgründen mit safe_mode on und BasicAuthentication die PHP_AUTH variablen PHP_AUT_USER und PHP_AUT_PASSW nicht mehr zur Verfügung. Mehr zu eventuellen Unterschieden findet sich im Changelog.

Bei der Graphikbibliothek gd steht die mit PHP geliefertere gd2 in Version 2.0.22 zur Verfügung. Damit lassen sich bei der Bildbearbeitung bessere Ergebnisse erzielen.

Bei PCRE wurde ebenfalls die mit PHP gelieferte Version verwendet, damit gibt es PCRE in Version 4.5.

Für die php.ini Datei gibt es im Vergleich zu php4.1.2 folgende neue Einstellungen:

Language Options

; The unserialize callback function will called (with the undefind class'

; name as parameter), if the unserializer finds an undefined class

; which should be instanciated.

; A warning appears if the specified function is not defined, or if the

; function doesn't include/implement the missing class.

; So only set this entry, if you really want to implement such a

; callback-function.

unserialize_callback_func=

; When floats & doubles are serialized store serialize_precision significant

; digits after the floating point. The default value ensures that when floats

; are decoded with unserialize, the data will remain the same.

 

serialize_precision = 100

; This directive allows you to disable certain classes for security reasons.

; It receives a comma-delimited list of class names. This directive is

; *NOT* affected by whether Safe Mode is turned On or Off.

disable_classes =

Resource Limits

max_input_time = 60 ; Maximum amount of time each script may spend parsing request data

Error handling and logging

; Set maximum length of log_errors. In error_log information about the source is

; added. The default is 1024 and 0 allows to not apply any maximum length at all.

log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same

; line until ignore_repeated_source is set true.

ignore_repeated_errors = Off

; If this parameter is set to Off, then memory leaks will not be shown (on

; stdout or in the log). This has only effect in a debug compile, and if

; error reporting includes E_WARNING in the allowed list

report_memleaks = On

; If html_errors is set On PHP produces clickable error messages that direct

; to a page describing the error or function causing the error in detail.

; You can download a copy of the PHP manual from www.php.net/docs.php

; and change docref_root to the base URL of your local copy including the

; leading '/'. You must also specify the file extension being used including

; the dot.

;docref_root = "/phpmanual/"

;docref_ext = .html

Paths and Directories

; cgi.force_redirect is necessary to provide security running PHP as a CGI under

; most web servers. Left undefined, PHP turns this on by default. You can

; turn it off here AT YOUR OWN RISK

; **You CAN safely turn this off for IIS, in fact, you MUST.**

; cgi.force_redirect = 1

; if cgi.nph is enabled it will force cgi to always sent Status: 200 with

; every request.

; cgi.nph = 1

; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape

; (iPlanet) web servers, you MAY need to set an environment variable name that PHP

; will look for to know it is OK to continue execution. Setting this variable MAY

; cause security issues, KNOW WHAT YOU ARE DOING FIRST.

; cgi.redirect_status_env = ;

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's

; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok

; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting

; this to 1 will cause PHP CGI to fix it's paths to conform to the spec. A setting

; of zero causes PHP to behave as before. Default is zero. You should fix your scripts

; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.

; cgi.fix_pathinfo=0

; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate

; security tokens of the calling client. This allows IIS to define the

; security context that the request runs under. mod_fastcgi under Apache

; does not currently support this feature (03/17/2002)

; Set to 1 if running under IIS. Default is zero.

; fastcgi.impersonate = 1;

; cgi.rfc2616_headers configuration option tells PHP what type of headers to

; use when sending HTTP response code. If it's set 0 PHP sends Status: header that

; is supported by Apache. When this option is set to 1 PHP will send

; RFC2616 compliant header.

; Default is zero.

;cgi.rfc2616_headers = 0

Fopen wrappers

; Define the User-Agent string

; user_agent="PHP"

; Default timeout for socket based streams (seconds)

default_socket_timeout = 60

; If your scripts have to deal with files from Macintosh systems,

; or you are running on a Mac and need to deal with files from

; unix or win32 systems, setting this flag will cause PHP to

; automatically detect the EOL character in those files so that

; fgets() and file() will work regardless of the source of the file.

; auto_detect_line_endings = Off

[MySQL]

; Maximum time (in secondes) for connect timeout. -1 means no limimt

mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and

; SQL-Erros will be displayed.

mysql.trace_mode = Off

[PostgresSQL]

; Detect broken persistent links always with pg_pconnect(). Need a little overhead.

pgsql.auto_reset_persistent = Off

; Ignore PostgreSQL backends Notice message or not.

pgsql.ignore_notice = 0

; Log PostgreSQL backends Noitce message or not.

; Unless pgsql.ignore_notice=0, module cannot log notice message.

pgsql.log_notice = 0

[Session]

; This option enables administrators to make their users invulnerable to

; attacks which involve passing session ids in URLs; defaults to 0.

; session.use_only_cookies = 1

; Define the probability that the 'garbage collection' process is started

; on every session initialization.

; The probability is calculated by using gc_probability/gc_divisor,

; e.g. 1/100 means there is a 1% chance that the GC process starts

; on each request.

session.gc_probability = 1

session.gc_divisor = 100

; PHP 4.2 and less have an undocumented feature/bug that allows you to

; to initialize a session variable in the global scope, albeit register_globals

; is disabled. PHP 4.3 and later will warn you, if this feature is used.

; You can disable the feature and the warning seperately. At this time,

; the warning is only displayed, if bug_compat_42 is enabled.

session.bug_compat_42 = 1

session.bug_compat_warn = 1

[mbstring]

; language for internal character representation.

;mbstring.language = Japanese

; enable automatic encoding translation accoding to

; mbstring.internal_encoding setting. Input chars are

; converted to internal encoding by setting this to On.

; Note: Do _not_ use automatic encoding translation for

; portable libs/applications.

;mbstring.encoding_translation = Off

; overload(replace) single byte functions by mbstring functions.

; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),

; etc. Possible values are 0,1,2,4 or combination of them.

; For example, 7 for overload everything.

; 0: No overload

; 1: Overload mail() function

; 2: Overload str*() functions

; 4: Overload ereg*() functions

;mbstring.func_overload = 0

 

Allgemeine Hinweise

Irren ist menschlich und daher kann es durchaus sein, dass hier nicht alle relevanten Neuerungen aufgezählt wurden. Die Konfiguration ist der jetzigen von php-4.1.2 angeglichen, d.h., dass z.B. weiterhin register_globals auf on stehen. Bei Problemen und Fragen hilft support@oder technik@ bestimmt weiter,

Viel Spaß

Mai 2004, Friedhelm Betz

Geändert am: 17.10.2005, 15:40 Uhr
Nach oben
Druckversion