我正在使用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文件中,我有这样的include行:
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 ...
梨版show:
% 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 stuff:
include_path .:/usr/local/lib/php/pear .:/usr/local/lib/php/pear
有什么问题吗?我需要你的帮助
编辑/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
一个解决方案吗?