【问题标题】:PEAR on PHP 7.2 on Windows 10PEAR 在 Windows 10 上的 PHP 7.2 上
【发布时间】:2018-08-15 11:48:12
【问题描述】:

在干净的 Windows 安装中,我安装了 PHP 7.2Nginx,它们都可以通过 Nginx 在命令行上正常工作。现在,我还想安装 PEAR 但这会输出 som PHP 错误,这些错误并不完全知道为什么会发生。

下面是我从官方文档页面http://pear.php.net/manual/en/installation.getting.php 获得的命令php .\go-pear.phar 的完整输出。

Name of configuration file [C:\WINDOWS\pear.ini] : $prefix

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : C:\tools\php
 2. Temporary directory for processing            : C:\tools\php\tmp
 3. Temporary directory for downloads             : C:\tools\php\tmp
 4. Binaries directory                            : C:\tools\php
 5. PHP code directory ($php_dir)                 : C:\tools\php\pear
 6. Documentation directory                       : C:\tools\php\docs
 7. Data directory                                : C:\tools\php\data
 8. User-modifiable configuration files directory : C:\tools\php\cfg
 9. Public Web Files directory                    : C:\tools\php\www
10. System manual pages directory                 : C:\tools\php\man
11. Tests directory                               : C:\tools\php\tests
12. Name of configuration file                    : C:\tools\php
13. Path to CLI php.exe                           : C:\tools\php

1-13, 'all' or Enter to continue:
Beginning install...
PHP Fatal error:  Uncaught Error: Call to undefined method PEAR_Error::set() in phar://C:/tools/php/go-pear.phar/PEAR/Start.php:322
Stack trace:
#0 phar://C:/tools/php/go-pear.phar/PEAR/Start/CLI.php(72): PEAR_Start->doInstall()
#1 phar://C:/tools/php/go-pear.phar/index.php(5): PEAR_Start_CLI->run()
#2 C:\tools\php\go-pear.phar(1271): require_once('phar://C:/tools...')
#3 {main}
  thrown in phar://C:/tools/php/go-pear.phar/PEAR/Start.php on line 322

Fatal error: Uncaught Error: Call to undefined method PEAR_Error::set() in phar://C:/tools/php/go-pear.phar/PEAR/Start.php:322
Stack trace:
#0 phar://C:/tools/php/go-pear.phar/PEAR/Start/CLI.php(72): PEAR_Start->doInstall()
#1 phar://C:/tools/php/go-pear.phar/index.php(5): PEAR_Start_CLI->run()
#2 C:\tools\php\go-pear.phar(1271): require_once('phar://C:/tools...')
#3 {main}
  thrown in phar://C:/tools/php/go-pear.phar/PEAR/Start.php on line 322

【问题讨论】:

标签: php windows pear


【解决方案1】:

答案实际上在文档的页面上: https://pear.php.net/manual/en/installation.php

Windows 7 will not allow the installation script to write to c:\windows\pear.ini. It gives the "Fatal error: Call to undefined method PEAR_Error::set()" error. Change the location of the configuration files (#11) to someplace writable, complete the installation, then copy the contents into c:\windows\pear.ini.

【讨论】:

    【解决方案2】:

    一个简单的解决方案是:以管理员身份运行 cmd。

    【讨论】:

      猜你喜欢
      • 2023-03-06
      • 2018-06-05
      • 2012-01-07
      • 1970-01-01
      • 2016-04-27
      • 1970-01-01
      • 1970-01-01
      • 2015-11-19
      • 1970-01-01
      相关资源
      最近更新 更多