You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

启动Apache服务器时遇/usr/sbin/httpd符号查找错误求助

Fixing Apache Startup Error: undefined symbol: apr_bucket_alloc_aligned_floor

Hey there, let's work through this Apache startup error together. The undefined symbol: apr_bucket_alloc_aligned_floor error almost always boils down to a mismatch between the Apache (httpd) binary and the APR (Apache Portable Runtime) libraries on your system. Here's how to diagnose and fix it:

Step 1: Diagnose the Dependency Mismatch

First, let's confirm which APR libraries httpd is trying to use, and compare them to the system's installed APR version:

  • Run this command to see the APR libraries linked to httpd:
    ldd /usr/sbin/httpd | grep apr
    
    This will show you the full paths of the APR libraries httpd is referencing.
  • Next, check the system's active APR version:
    apr-1-config --version
    
    If the version from apr-1-config doesn't match the libraries linked in the first command, or if the library paths point to outdated/mismatched files, that's your root cause.

Step 2: Fix Library Path Issues

Sometimes httpd is picking up the wrong APR libraries because of incorrect library path configurations:

  • Try temporarily setting the library path to point to the correct APR libraries (replace /path/to/correct/apr/lib with the valid path from your ldd output or your system's official APR libs):
    export LD_LIBRARY_PATH=/path/to/correct/apr/lib:$LD_LIBRARY_PATH
    
  • Then attempt to start httpd again:
    service httpd start
    
  • If this works, make the path change permanent by adding the APR library path to a new config file:
    echo "/path/to/correct/apr/lib" > /etc/ld.so.conf.d/apr.conf
    ldconfig
    

Step 3: Reinstall or Recompile Matching Components

If the path fix doesn't work, you'll need to ensure httpd and APR are fully compatible:

For Package-Managed Systems (Yum/DNF/Apt)

  • Uninstall the existing mismatched packages:
    # For RHEL/CentOS
    yum remove httpd apr apr-util
    # For Debian/Ubuntu
    apt purge apache2 libapr1 libaprutil1
    
  • Reinstall the official, compatible packages:
    # For RHEL/CentOS
    yum install httpd apr apr-util
    # For Debian/Ubuntu
    apt install apache2 libapr1 libaprutil1
    

For Manually Compiled Apache

If you built httpd from source, recompile it with the correct APR libraries:

  • First, clean old build files:
    make clean
    
  • Configure the build with explicit paths to your APR and APR-util installations:
    ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
    
  • Recompile and install:
    make && make install
    

Step 4: Verify the Fix

After making changes, confirm Apache starts successfully:

# For systemd systems
systemctl start httpd
systemctl status httpd

# For non-systemd systems
service httpd start
service httpd status

You can also double-check the linked libraries again with ldd /usr/sbin/httpd | grep apr to ensure everything matches.

内容的提问来源于stack exchange,提问作者ganesh sekaran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 07:35:17