Konstante PEAR_INSTALL_DIR

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Konstante PEAR_INSTALL_DIR

Postby Dralon » 02. December 2006 21:52

Die Konstante PEAR_INSTALL_DIR enthält auf meinem System (XAMPP für Windows 1.5.4) den Wert C:\php5\pear obwohl das PEAR-Verzeichnis bei mir unter C:\xampp\php\pear liegt.

Ich habe das gesamte xampp-Verzeichnis durchsucht, anscheinend wird die Konstante in der DLL php5ts.dll definiert.

Ist das ein XAMPP-spezifischer Bug oder soll man ihn woanders melden?

Grüße
Dralon

P.S. Diese Konstante wird offensichtlich nur von wenigen Packages verwendet (u.a. Image_Barcode), stellt also kein allzugroßes Problem dar.
Dralon
 
Posts: 5
Joined: 02. December 2006 20:43

Postby buzzi » 24. July 2007 13:46

wie kann man das Problem lösen! Ich bräuchte das Image Barcode Package?
buzzi
 
Posts: 5
Joined: 06. February 2005 01:56

Postby DJ DHG » 24. July 2007 14:00

Moin Moin!

Versuche es mit:

Code: Select all
define ("PEAR_INSTALL_DIR", "C:\xampp\php\pear");

oder
Code: Select all
set_include_path();


oder die Umgebungsvariablen ändern.

mfg DJ DHG
User avatar
DJ DHG
AF Moderator
 
Posts: 2455
Joined: 27. December 2002 13:50
Location: Kiel

Postby buzzi » 24. July 2007 14:11

geht beides leider nicht, muss irgendwo hardgecodet sein!
Er zeigt mir bei
Code: Select all
echo PEAR_INSTALL_DIR;

immer
Code: Select all
c:\php4\pear
an !
hab gerade diesen link gefunden, bloss hilft mir das nicht weiter ?

http://bugs.php.net/bug.php?id=17516
buzzi
 
Posts: 5
Joined: 06. February 2005 01:56

Postby MarioR » 05. September 2007 10:38

Hallo,

ich habe das gleiche Problem, nur mit PHP5

Code: Select all
C:\php5\pear


Die Konstante PEAR_INSTALL_DIR ist eine CORE-Konstante
laut http://de2.php.net/manual/de/reserved.constants.php

Heißt dass etwa, dass man diese nicht ändern kann?

Was auch lustig ist, einmal "pear -V" ausführen:

Dort sind die richtigen und falschen

Code: Select all
D:\Anwendungen\Xampp\php>pear -V
PEAR Version: 1.4.11
PHP Version: 5.2.3
Zend Engine Version: 2.2.0
Running on: Windows NT PC50659 5.1 build 2600

D:\Anwendungen\Xampp\php>pear config-show
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          D:\Anwendungen\Xampp\php
PEAR documentation directory   doc_dir          C:\php5\pear\docs
PHP extension directory        ext_dir          D:\Anwendungen\Xampp\php\ext\
PEAR directory                 php_dir          D:\Anwendungen\Xampp\php\pear
PEAR Installer cache directory cache_dir        C:\DOCUME~1\ROSENB~1\LOCALS~1\Te
mp\pear\cache
PEAR data directory            data_dir         [b]C:\php5\pear\data[/b]
PEAR Installer download        download_dir     C:\DOCUME~1\ROSENB~1\LOCALS~1\Te
mp\pear\cache
directory
PHP CLI/CGI binary             php_bin          D:\Anwendungen\Xampp\php\.\php.e
xe
PEAR Installer temp directory  temp_dir         C:\DOCUME~1\ROSENB~1\LOCALS~1\Te
mp\pear\temp
PEAR test directory            test_dir         C:\php5\pear\tests
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            0
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          c:\gnupg\gpg.exe
Signature Key Directory        sig_keydir       C:\WINDOWS\pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         C:\WINDOWS\pear.ini
System Configuration File      Filename         C:\WINDOWS\pearsys.ini



obwohl in der "pear.ini" etwas ganz anderes drinnen steht:


Code: Select all
#PEAR_Config 0.9
a:8:{s:15:"preferred_state";s:6:"stable";s:7:"bin_dir";s:10:"\Xampp\php";
s:7:"php_dir";s:15:"\xampp\php\pear";
s:7:"doc_dir";s:20:"\xampp\php\pear\docs";
s:8:"data_dir";s:20:"\xampp\php\pear\data";
s:8:"test_dir";s:21:"\xampp\php\pear\tests";
s:7:"php_bin";s:18:"\xampp\php\php.exe";
s:10:"__channels";a:2:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}}}


Irgendwie sieht mir das wie ein Bug aus.:?

Gibt es eigendlich einen bei dem ..
Code: Select all
<?php
echo PEAR_INSTALL_DIR."<br>";
?>

.. das richtige Verzeichnis liefert?

probiert es bitte einmal aus und postet die Ergebnisse.

Dankeschön schon mal im Voraus

Mario
MarioR
 
Posts: 4
Joined: 30. November 2003 15:15

Temporär gelöst

Postby MarioR » 06. September 2007 07:36

Hallo,

da sich das Problem anscheinend nicht so schnell lösen lässt, jedenfalls
habe ich die Quelle von "PEAR_INSTALL_DIR" nicht gefunden, habe
ich das problem per "hack" gelöst:

1. in "D:\Anwendungen\Xampp" per
Code: Select all
"grep -d+ -l+ PEAR_INSTALL_DIR *.* >files.txt

das vorkommen der Konstanten suchen.

2. entscheidend sind folgende Funde:
Code: Select all
File php\PEAR\Image\Barcode.php:
64              $barcodepath = PEAR_INSTALL_DIR . DIRECTORY_SEPARATOR . "Image" . DIRECTORY_SEPARATOR . "Barcode";
File php\PEAR\PEAR\Config.php:
38      if (!defined('PEAR_INSTALL_DIR') || !PEAR_INSTALL_DIR) {
39          $PEAR_INSTALL_DIR = PHP_LIBDIR . DIRECTORY_SEPARATOR . 'pear';
41          $PEAR_INSTALL_DIR = PEAR_INSTALL_DIR;
File php\PEAR\PEAR\Registry.php:
140         function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false,


Dann habe ich die Dateien wie folgt geändert:

File php\PEAR\Image\Barcode.php:
Code: Select all
        /**** Zeile 64 ***/
          Orginal:
          $barcodepath = PEAR_INSTALL_DIR . DIRECTORY_SEPARATOR . "Image" . DIRECTORY_SEPARATOR . "Barcode";

        Hack:
        $barcodepath = 'D:\\Anwendungen\\Xampp\\php\\PEAR' . DIRECTORY_SEPARATOR . "Image" . DIRECTORY_SEPARATOR . "Barcode";



File php\PEAR\PEAR\Config.php:
Code: Select all
        /**** ab Zeile 64 ***/
       Orginal:
       if (!defined('PEAR_INSTALL_DIR') || !PEAR_INSTALL_DIR) {
         $PEAR_INSTALL_DIR = PHP_LIBDIR . DIRECTORY_SEPARATOR . 'pear';
      } else {
        $PEAR_INSTALL_DIR = PEAR_INSTALL_DIR;
      }
 
     Hack: komplett ersetzen durch
    $PEAR_INSTALL_DIR = 'D:\\Anwendungen\\Xampp\\php\\PEAR';


File php\PEAR\PEAR\Registry.php:
Code: Select all
        /**** ab Zeile 140 ***/
  Orginal:
    function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false,
                           $pecl_channel = false)

   Hack:
    function PEAR_Registry($pear_install_dir = 'D:\\Anwendungen\\Xampp\\php\\PEAR', $pear_channel = false,
                           $pecl_channel = false)


Nach dieser Änderung liefert:
Code: Select all
D:\Anwendungen\Xampp\php>pear config-show
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       http-proxy-dp1.dmz.k-plus-s.net:
8080
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          D:\Anwendungen\Xampp\php
PEAR documentation directory   doc_dir          D:\Anwendungen\Xampp\php\PEAR\do
cs
PHP extension directory        ext_dir          D:\Anwendungen\Xampp\php\ext\
PEAR directory                 php_dir          D:\Anwendungen\Xampp\php\pear
PEAR Installer cache directory cache_dir        C:\DOCUME~1\ROSENB~1\LOCALS~1\Te
mp\pear\cache
PEAR data directory            data_dir         D:\Anwendungen\Xampp\php\PEAR\da
ta
PEAR Installer download        download_dir     C:\DOCUME~1\ROSENB~1\LOCALS~1\Te
mp\pear\cache
directory
PHP CLI/CGI binary             php_bin          D:\Anwendungen\Xampp\php\.\php.e
xe
PEAR Installer temp directory  temp_dir         C:\DOCUME~1\ROSENB~1\LOCALS~1\Te
mp\pear\temp
PEAR test directory            test_dir         D:\Anwendungen\Xampp\php\PEAR\te
sts
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            0
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          c:\gnupg\gpg.exe
Signature Key Directory        sig_keydir       C:\WINDOWS\pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         C:\WINDOWS\pear.ini
System Configuration File      Filename         C:\WINDOWS\pearsys.ini


Auch die Installation von Struts4PHP funktioniert richtig und erstellt kein Verzeichnisse "C:\php5\... " mehr.

... na dann, wollen wir mal arbeiten ...

Gruß Mario
MarioR
 
Posts: 4
Joined: 30. November 2003 15:15


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 42 guests