我被要求检查一台为新开发人员设置的笔记本电脑(OS X,10.5),我发现缺少 pear 可执行文件。这家商店从源代码设置 PHP,因此我导航到他们编译了内容的源代码树并尝试 make install,但失败了
Installing PEAR environment: /usr/local/lib/php/
dyld: Library not loaded: /b/32_216/rdbms/lib/libclntsh.dylib.10.1
Referenced from: /Users/username/Source/php-5.2.8/sapi/cli/php
Reason: image not found
make[1]: *** [install-pear-installer] Trace/BPT trap
make: *** [install-pear] Error 2
因此我尝试了 configure/make clean/make/make install,但遇到了同样的问题。
所有这些命令都是用 运行的sudo
,因为源树归 root 拥有。
我把问题追溯到这个命令make -n install-pear
sudo /Users/username/Source/php-5.2.8/sapi/cli/php -n -dshort_open_tag=0 -dsafe_mode=0 -dopen_basedir= -derror_reporting=E_ALL -dmemory_limit=-1 -ddetect_unicode=0 pear/install-pear-no zlib.phar -d "/usr/local/lib/php" -b "/usr/local/bin"-dshort_open_tag=0 -dsafe_mode=0 -dopen_basedir= -derror_reporting=E_ALL -dmemory_limit=-1 -ddetec
Installing PEAR environment: /usr/local/lib/php/
dyld: Library not loaded: /b/32_216/rdbms/lib/libclntsh.dylib.10.1
Referenced from: /Users/username/Source/php-5.2.8/sapi/cli/php
Reason: image not found
make[1]: *** [install-pear-installer] Trace/BPT trap
make: *** [install-pear] Error 2
奇怪的是,当我以非 root 用户身份运行该命令时,我似乎进一步推进
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Console_Getopt: failed to mkdir /usr/local/lib/php/Console
[PEAR] Archive_Tar: failed to mkdir /usr/local/lib/php/Archive
[PEAR] Structures_Graph: failed to mkdir /usr/local/lib/php/doc/Structures_Graph/docs/html/media
warning: pear/PEAR requires package "pear/Archive_Tar" (recommended version 1.3.2)
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.2)
warning: pear/PEAR requires package "pear/Console_Getopt" (recommended version 1.2.3)
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
[PEAR] PEAR: failed to mkdir /usr/local/lib/php/OS
(尽管当以 sudo 形式运行时,这些命令在成功时可能会静默运行。)
我认为这可能是以$PATH
sudo 身份运行时出现的问题,但似乎一切都很相似。
$ sudo echo $PATH
/usr/local/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin:/usr/local/instantclient
$ echo $PATH
/usr/local/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin:/usr/local/instantclient
该/usr/local/instantclient
文件夹是丢失的库所在的位置。
我有点不知道下一步“我要检查什么”的步骤是什么,并希望在把问题转回给 IT 人员之前 ServerFault 能够帮助我。
答案1
这是你的问题:
dyld: Library not loaded: /b/32_216/rdbms/lib/libclntsh.dylib.10.1
您的卷根目录下可能没有 /b 目录。我不确定他们为什么要设置从那里拉取某些内容 - 也许可以检查其他机器之一,看看他们的卷根目录下是否有 /b 目录树。