【发布时间】:2018-07-23 21:19:37
【问题描述】:
在过去的几个小时里,我一直对此束手无策,试图弄清楚发生了什么。我正在运行 SLES 12 SP3 服务器并且需要从 PHP 连接到 Microsoft SQL Server 数据库,我按照 microsoft 的文档直到它要求我运行这个命令:
pecl install sqlsrv
命令失败并显示以下相关输出:
checking whether the C compiler works... no
configure: error: in `/tmp/pear/temp/pear-build-rootLa81RX/sqlsrv-5.3.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
rolling back 8 file operations
ERROR: `/tmp/pear/temp/sqlsrv/configure --with-php-config=/usr/bin/php-config' failed
我很想查看 config.log 以获取更详细的错误信息,但似乎 /tmp/pear/temp 目录中的所有内容在尝试失败后立即被删除,包括日志。为了诊断错误,我尝试使用 gcc 构建以下 C 文件:
#include <stdio.h>
int main() { printf("hello world\n"); return 0; }
得到了同样奇怪的错误:
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/../../../../lib64/crt1.o: unrecognized relocation (0x2a) in section `.text'
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
此时,我正式不知道该去哪里尝试诊断这里实际发生的情况。
【问题讨论】:
-
你从哪里得到 GCC 8 的安装?我认为 SLES SP3 工具链模块仍处于 GCC 7。
-
我所做的只是 zypper install gcc
-
你也更新了 binutils 吗?
标签: sql-server gcc pear pecl