【问题标题】:Failed opening required 'PEAR.php' (include_path='.:/usr/local/lib/php/pear') in /usr/local/lib/php/pear/common.php on line 22在第 22 行的 /usr/local/lib/php/pear/common.php 中打开所需的 'PEAR.php' (include_path='.:/usr/local/lib/php/pear') 失败
【发布时间】:2021-02-23 17:20:18
【问题描述】:

我正在使用 macOS BigSur 并尝试使用本地 Web 服务器 apache2。一切都很好,因为我收到了这个致命错误:

Fatal error: require_once(): Failed opening required 'PEAR.php' (include_path='.:/usr/local/lib/php/pear') in /usr/local/lib/php/pear/common.php on line 22

尝试修复它:

% php --ini                   
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

在 php.ini 文件中我有这个包含行:

display_errors = on
error_reporting = -1
include_path = ".:/usr/local/lib/php/pear"

与:

% pear config-get php_dir     
/usr/local/lib/php
% pear
Commands:
build                  Build an Extension From C Source
bundle                 Unpacks a Pecl Package
channel-add            Add a Channel
channel-alias          Specify an alias to a channel name
channel-delete         Remove a Channel From the List ...

梨版秀:

 % pear version
    PEAR Version: 1.10.12
    PHP Version: 7.3.24-(to be removed in future macOS)
    Zend Engine Version: 3.3.24
    Running on: Darwin MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

在 phpInfo 文件中我有 include_path 的东西:

include_path    .:/usr/local/lib/php/pear   .:/usr/local/lib/php/pear

有什么问题?我需要你的帮助。

【问题讨论】:

    标签: php pear macos-big-sur


    【解决方案1】:

    像这样编辑 /etc/php.ini 文件后:

    include_path = ".:/usr/local/lib/php:/usr/local/lib/php/pear"
    

    现在有关于第一个的错误。发生另一个错误:

    Fatal error: Cannot declare class PEAR_Common, because the name is already in use in /usr/local/lib/php/PEAR/Common.php on line 835
    

    一个解决方案?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-22
      • 2016-10-05
      • 2014-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多