PEAR directory problem on Windows

前端 未结 6 648
粉色の甜心
粉色の甜心 2021-02-02 03:24

I\'ve downloaded the ZIP archive of PHP and extracted it under my profile. I then needed some PEAR packages. go-pear.bat apparently installed PEAR just fine, I just

6条回答
  •  鱼传尺愫
    2021-02-02 04:06

    The problem is that PEAR looks for its ini file in the Windows directory, and because it doesn't find it there, it resorts to guessing the location. Even worse, you can't change any configuration settings with pear config-set because PEAR doesn't have a pear.ini to write to. At the same time, PEAR ignores an existing pear.ini file in its own directory. It's a mess. See this bug report.

    If there is just one global PEAR install, PEAR can be told where to look for an ini file by creating an environment variable, PHP_PEAR_SYSCONF_DIR, pointing to the right directory.

    But if there are multiple, local PEAR installs, you'll have to patch pear.bat by adding this line:

    IF "%PHP_PEAR_SYSCONF_DIR%"=="" SET "PHP_PEAR_SYSCONF_DIR=C:\path\to\pear.ini\directory"

提交回复
热议问题