php.de

Zurück   php.de > Webentwicklung > Server, Hosting und Workstations

Server, Hosting und Workstations Server-Konfigurationsdateien (.htaccess/httpd.conf) und Arbeiten auf Serverebene

Antwort
 
LinkBack Themen-Optionen Thema bewerten
Alt 24.11.2004, 20:41  
Erfahrener Benutzer
 
Registriert seit: 26.09.2004
Beiträge: 430
toscho
Standard include_path in .htaccess systemabhängig setzen

Hallo,

ich möchte einem kleinen Script eine vorgefertigte ».htaccess« mitgeben, in der der include_path gesetzt wird.
Mein Problem: Ich will das möglichst portabel machen. Daher soll in der ».htaccess« die richtige Syntax abhängig davon gesetzt werden, auf welchem Betriebsystem der Apache gerade läuft.
Also im Groben etwa so:
Code:
<If operating system = Windows>
    php_value include_path .;\pfad
<EndIf>
<If operating system = UNIX>
    php_value include_path .:/pfad
<EndIf>
Wie mache ich das? Ich habe schon der Apache-Doku gestöbert, auf php.net und natürlich hier im Forum gesucht, aber nichts Passendes gefunden.

Gruß
Thomas
toscho ist offline   Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 26.11.2004, 12:50  
Gast
 
Beiträge: n/a
Standard

Ich nem an der Apache gibt diese Information nicht her innerhalb ner .htaccess, aber du könntest innerhalb von PHP den String aus $_SERVER[SERVER_SOFTWARE] auslesen, da steht was drin wie "Apache/2.0.48 (Unix)". Und dann mit nem Stringvergleich das Betriebssystem feststellen und den include_path setzen mit set_include_path() oder ini_set().

Wolfgang



edit by supertramp:
wir sind kein werbungsforum .. also bleibt die domain der eigenen homepage aus den postings draußen. in der Signatur ists ok.
  Mit Zitat antworten
Alt 26.11.2004, 17:09  
Erfahrener Benutzer
 
Registriert seit: 26.09.2004
Beiträge: 430
toscho
Standard

Ja, das weiß ich. Ich möchte jedoch ein »auto_prepend_file« setzen, und das geht nur in der ».htaccess« und es orientiert sich am Wert von »include_path«.

Naja, vermutlich muß mir was anderes einfallen lassen…

Gruß
Thomas
toscho ist offline   Mit Zitat antworten
Alt 26.11.2004, 18:03  
Gast
 
Beiträge: n/a
Standard

@toscho
>Ich möchte jedoch ein »auto_prepend_file« setzen, und das geht nur in der ».htaccess«

Falsch:
auto_prepend_file PHP_INI_SYSTEM | PHP_INI_PERDIR

auto_prepend_file kann also bei mod-Php nur mit php_admin_value gesetzt werden. Allerdings schließt das 'admin' den Einsatz in .htaccess aus.

>und es orientiert sich am Wert von »include_path«.

"... dabei wird ein gesetzter include_path beachtet."

So zB. isses sauberer:
Code:
# httpd.conf -> im virtualhost
php_admin_value include_path ".:/path/zum/verzeichnis"
php_admin_value auto_prepend_file /path/zum/verzeichnis/prepend.php
  Mit Zitat antworten
Alt 26.11.2004, 18:37  
Erfahrener Benutzer
 
Registriert seit: 26.09.2004
Beiträge: 430
toscho
Standard

PHP_INI_PERDIR kann auch in der ».htaccess« gesetzt werden.
Aus http://de3.php.net/manual/en/function.ini-set.php
Zitat:
PHP_INI_PERDIR 2 Entry can be set in php.ini, .htaccess or httpd.conf
Gruß
Thomas
toscho ist offline   Mit Zitat antworten
Alt 26.11.2004, 18:40  
Gast
 
Beiträge: n/a
Standard

Zitat:
Zitat von toscho
PHP_INI_PERDIR kann auch in der ».htaccess« gesetzt werden.
Stimmt.
  Mit Zitat antworten
Antwort


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
.htaccess login schlägt fehl sternschnuppe99 Server, Hosting und Workstations 6 07.02.2008 13:37
Einstellungen in .htaccess Der_Gerhard PHP Tipps 2008 3 12.09.2007 02:02
.htaccess Verzeichnisschutz oder Umleitung Igäl Server, Hosting und Workstations 2 24.08.2007 17:23
Auf eine Flashanimation einen Link setzen andrew22 HTML, Usability und Barrierefreiheit 23 06.03.2007 15:28
.htaccess LA-Finest HTML, Usability und Barrierefreiheit 4 28.02.2007 22:39
.htaccess Ausnahme für einzelne Verzeichnisse ssm Server, Hosting und Workstations 0 25.02.2007 19:24
register_globals per .htaccess auf off stellen A Hoppe PHP Tipps 2006 4 26.03.2006 12:58
.htaccess und Co. PHP Tipps 2007 7 19.12.2005 08:19
[Erledigt] Gültigkeitsdauer eines Cookies lässt sich nicht setzen PHP Tipps 2005-2 8 21.10.2005 13:25
Dateien erstellen und chmod setzen auch wenns nicht geht ^^ PHP Tipps 2005 8 22.05.2005 02:53
Sichere Vebindung mit MySQL & .htaccess erstellen + Vars PHP Tipps 2005 8 17.03.2005 16:56
2 Tabellen abfragen und dann variable unterschiedlich setzen Anuschka PHP Tipps 2004-2 2 22.12.2004 02:46
[Erledigt] .htaccess verweigert meinen zugriff HTML, Usability und Barrierefreiheit 4 22.09.2004 17:28
.htaccess wird ignoriert PHS PHP Tipps 2004 5 05.09.2004 15:51
Problem mit .htaccess und php PHP Tipps 2004 2 05.07.2004 14:06

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
htaccess include_path, include_path htaccess, .htaccess include_path, apache include_path, include_path, include_path .htaccess, auto_prepend_file htaccess, php include_path htaccess, php_value include_path, apache2 include_path, htaccess php_value include_path, include_path in htaccess, http://www.php.de/server-hosting-und-workstations/12886-include_path-htaccess-systemabhaengig-setzen.html, htaccess include_path setzen, php include_path .htaccess, php_value include_path windows, htaccess auto_prepend_file, include_path php, include_path apache, htaccess php include_path

Alle Zeitangaben in WEZ +2. Es ist jetzt 00:17 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.