php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2005

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 16.02.2005, 14:13  
Benutzer
 
Registriert seit: 28.11.2003
Beiträge: 37
Diet
Standard Php 4.3.6 und 5.0.3 auf Win XP-Probleme mit php.ini

Hallo,
habe unter Win XP mit Apache Server Php 4.3.6 und 5.03 installiert (CGI-Version)
Laut phpinfo() zeigen aber beide auf die gleiche php.ini im Ordner c:\windows\php.ini
Wie kann ich das ändern, so dass ich für jede Version eine getrennte ini-Datei habe?
Danke im voraus!
Diet ist offline  
Sponsor Mitteilung
PHP Code Flüsterer

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

Alt 16.02.2005, 15:02  
Moderator
 
Benutzerbild von robo47
 
Registriert seit: 03.09.2004
Beiträge: 11.792
PHP-Kenntnisse:
Fortgeschritten
robo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz sein
Standard

Code:
PHP searches for php.ini in the following locations (in
   order):

     * PHPIniDir directive (Apache 2 module only)
     * HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath
     * The PHPRC environment variable
     * Directory of PHP (for CLI), or the web server's directory (for
       SAPI modules)
     * Windows directory (C:\windows or C:\winnt)

   If you are running Apache 2, the simpler option is to use the
   PHPIniDir directive (read the installation on Apache 2 page),
   otherwise your best option is to set the PHPRC environment variable.
   This process is explained in the following FAQ entry.

     Note: If you're using NTFS on Windows NT, 2000, XP or 2003, make
     sure that the user running the web server has read permissions to
     your php.ini (e.g. make it readable by Everyone).
Code:
# For PHP 4
Action application/x-httpd-php "/php/php.exe"

# For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"

# specify the directory where php.ini is
SetEnv PHPRC C:/php
Code:
Installing as an Apache module

   You need to insert these two lines to your Apache httpd.conf
   configuration file to set up the PHP module for Apache 2.0:

   Example 2-6. PHP and Apache 2.0 as Module
# For PHP 4 do something like this:
LoadModule php4_module "c:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php

# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

     Note: Remember to substitute the c:/php/ for your actual path to
     PHP in the above examples. Take care to use either php4apache2.dll
     or php5apache2.dll in your LoadModule directive and not
     php4apache.dll or php5apache.dll as the latter ones are designed to
     run with Apache 1.3.x.

   Warning

   Don't mix up your installation with DLL files from different PHP
   versions. You have the only choice to use the DLL's and extensions
   that ship with your downloaded PHP version.
Code:
Chapter 4. Runtime Configuration

The configuration file

   The configuration file (called php3.ini in PHP 3, and simply php.ini
   as of PHP 4) is read when PHP starts up. For the server module
   versions of PHP, this happens only once when the web server is
   started. For the CGI and CLI version, it happens on every invocation.

   The default location of php.ini is a compile time option (see the FAQ
   entry), but can be changed for the CGI and CLI version with the -c
   command line switch, see the chapter about using PHP from the command
   line. You can also use the environment variable PHPRC for an
   additional path to search for a php.ini file.

   If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is
   e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini.

     Note: The Apache web server changes the directory to root at
     startup causing PHP to attempt to read php.ini from the root
     filesystem if it exists.
bringt dir vieleicht was, schau mal in der install.txt des php's, da findest du vieleicht mehr was relevant ist

oder benutze xampp, da kannst du ganz bequem zwischen php4 und 5 switchen (laufen nciht synchron)

mfg
robo47
robo47 ist offline  
Alt 16.02.2005, 16:01  
Benutzer
 
Registriert seit: 28.11.2003
Beiträge: 37
Diet
Standard

Danke,
der Ansatz war sehr gut!
Habe es folgendermassen in der http.conf gelöst:
Code:
ScriptAlias /php/ "c:/php/"
   AddType application/x-httpd-php .php .php4 .php3 .phtml
   #AddType application/x-httpd-php-source .phps
   Action application/x-httpd-php "/php/php.exe"



    #php 5 ab hier einbinden----------------
ScriptAlias /php5/ "c:/php5/"
   AddType application/x-httpd-php5 .php5

   Action application/x-httpd-php5 "/php5/php-cgi.exe"
   SetEnv PHP5RC /php5/
Die php.ini für PHP4 ist nun in c:/windows und die php.ini für PHP5 in c:/php5/
Diet ist offline  
 


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
php.ini & error_* squig PHP Tipps 2007 2 25.12.2006 22:18
Probleme bei Speicherung von serialize() Strings Manni2k PHP Tipps 2006 13 15.10.2006 15:06
Was sind Voraussetzungen für eine locale php.ini stani PHP Tipps 2006 1 07.10.2006 14:42
suPHP erkennt php.ini nicht Sundriver Server, Hosting und Workstations 0 29.04.2006 18:14
[Erledigt] php.ini Konfigurations Probleme PHP-Fortgeschrittene 1 11.02.2006 10:57
PHP.ini wird nicht gefunden PHP Tipps 2006 5 03.01.2006 17:29
Probleme bei der Installation von Turck MMCache tomx992 PHP-Fortgeschrittene 2 27.09.2005 20:31
php.ini änderungen nicht wirksam Server, Hosting und Workstations 19 22.04.2005 17:04
Pfadangabe in php.ini funktioniert nicht PHP Tipps 2005 10 29.03.2005 15:16
php.ini bearbeiten Juuro Server, Hosting und Workstations 13 01.02.2005 22:51
PHP 5.0.3 neu installiert PHP Tipps 2005 1 30.01.2005 16:23
[Erledigt] Server lokal - php.ini Timeout einstellen PHP-Fortgeschrittene 7 28.12.2004 12:05
[Erledigt] Technische Probleme mit Sessions PHP-Fortgeschrittene 4 18.11.2004 14:45
Probleme mit Apache2 und PHP5 nach Update von PHP4 Server, Hosting und Workstations 9 28.10.2004 16:01
probleme mit php 4.3.6 PHP Tipps 2004 9 15.06.2004 18:54

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
php.ini xp einstellen, php 4.3.6 for apache, php cgi windows ini path -iis, php4 für php5 anpassen, php-cgi.exe scriptalias einbinden, php probleme mit parse ini, apache server auf windows erkennt php-dateien nicht php-cgi.exe

Alle Zeitangaben in WEZ +2. Es ist jetzt 09:01 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.