【问题标题】:Installing PHP on FreeBSD 10 gives compilation error在 FreeBSD 10 上安装 PHP 会出现编译错误
【发布时间】:2014-06-29 05:46:33
【问题描述】:

我在我的系统上安装了 apache 2.4

./configure --enable-so

然后 MySQL 设置并运行没有问题。但现在我正在尝试使用这些参数安装 PHP:

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql

make 上我收到错误:

ext/standard/info.o: In function `php_info_print':
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
ext/standard/info.o: In function `php_info_printf':
/root/php-5.5.13/ext/standard/info.c:83: undefined reference to `ts_resource_ex'
ext/standard/info.o:/root/php-5.5.13/ext/standard/info.c:97: more undefined references to `ts_resource_ex' follow
ext/standard/info.o: In function `php_print_info':
/root/php-5.5.13/ext/standard/info.c:869: undefined reference to `executor_globals_id'
/root/php-5.5.13/ext/standard/info.c:872: undefined reference to `executor_globals_id'
/root/php-5.5.13/ext/standard/info.c:875: undefined reference to `executor_globals_id'
/root/php-5.5.13/ext/standard/info.c:878: undefined reference to `executor_globals_id'
ext/standard/info.o: In function `php_info_print':
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
ext/standard/info.o:/root/php-5.5.13/ext/standard/info.c:97: more undefined references to `ts_resource_ex' follow
ext/standard/info.o: In function `php_print_gpcse_array':
/root/php-5.5.13/ext/standard/info.c:204: undefined reference to `executor_globals_id'
ext/standard/info.o: In function `php_info_print':
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex'
ext/standard/info.o: In function `php_info_print_html_esc':
/root/php-5.5.13/ext/standard/info.c:69: undefined reference to `ts_resource_ex'
ext/standard/info.o:/root/php-5.5.13/ext/standard/info.c:97: more undefined references to `ts_resource_ex' follow
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /root/php-5.5.13

请指点我正确的方向:)

【问题讨论】:

    标签: php gnu-make freebsd


    【解决方案1】:

    FreeBSD 有ports collection。这是一个构建各种软件包的基础设施。如果您正在寻找的东西可以从端口获得,那么最好使用它。因为其他人已经弄清楚如何最好地安装程序。

    例如要安装 php5,切换到root 用户,转到/usr/ports/lang/php5 并输入命令make install clean。这将为您编译和安装 PHP,包括它所依赖的任何东西。

    很多端口都带有选项;可以更改的配置项。如果您对端口的默认配置感到满意,则可以将其安装为预构建的包。例如。寻找 PHP 5 包;

    > pkg search php5|less
    ja-php5-mecab-0.5.0
    mod_php5-5.4.29,1
    mod_php55-5.5.13
    php5-5.4.29
    php5-Ice-3.5.1
    php5-arcanist-20140508_2
    php5-bcmath-5.4.29
    php5-blitz-0.8.2
    php5-blitz-devel-0.7.2
    php5-bsdconv-11.1.0
    ...
    

    然后安装你想要的;

    # pkg install php5-5.4.29
    Updating repository catalogue
    The following 1 packages will be installed:
    
        Installing php5: 5.4.29
    
    The installation will require 15 MB more space
    
    2 MB to be downloaded
    
    Proceed with installing packages [y/N]: y
    

    编辑:要获得libphp5.so,您需要激活嵌入选项。这不在默认值中,因此在这种情况下您不能使用包。

    【讨论】:

    • 如果我从端口安装,文件 libphp5.so 不会创建
    • @Nordenheim 检查端口的pkg-plist;您必须启用 EMBED 选项才能获得 libphp5.so
    猜你喜欢
    • 2018-04-29
    • 2014-02-07
    • 2013-11-02
    • 1970-01-01
    • 1970-01-01
    • 2013-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多