inside the mind of a linux admin

mod_python failing to compile due to bug in connobject.c

I recently recompiled PHP on a server I own to upgrade it to the latest version. This particular server runs cPanel, which usually makes this otherwise tedious process much simpler. However, when recompiling mod_python it errors out with this message:

touch connobject.slo connobject.c: In function '_conn_read':
connobject.c:142: error: request for member 'next' in something not a structure or union
apxs:Error: Command failed with rc=65536
make[1]: *** [] Error 1

The entire process then fails and reverts itself to the last known working LAMP stack.

The problem is actually a known bug, and is fixable with a bit of hackery. If you are not using a cPanel server, it’s very easy. Just simple change one line at your leisure prior to compiling.

If you are using a cPanel server, you need to time the patch correctly. Let me elaborate.

First, the bug itself is in connobject.c on line 142.

To fix, simply replace:




Simple enough.

Now, back to cPanel. Since easy apache will download fresh copies of the source upon each build session, you need to apply the fix strategically AFTER it downloads the fresh copy, but BEFORE it attempts to compile it. There is a window of approximately 1-2 minutes to do this, depending on the speed of your server.

Here’s a trick that I used to make sure I’m catching it.

First before starting the build, remove the file entirely

# rm -f /home/cpeasyapache/src/mod_python-3.3.1/src/connobject.c

Second, start the build process.

Now, do a simple while loop or just manually check for the file periodically. Once it appears, you know you’re working with the fresh copy from the build and can perform your edit on line 142.

# while true ; do ls /home/cpeasyapache/src/mod_python-3.3.1/src/connobject.c ; sleep 5; done

Once you’ve edited the buggy line, save the file, sit back and wait for the build to complete (successfully).

Hope this helped!

Bug reported at:

Related Posts

How to revert back to X11 / Xorg from Wayland

Wayland is intended as a “simpler replacement for X”, and is getting quite a bit of hype around the Linux community. So much so, that it’s the default in the latest versions of Fedora, GNOME, KDE and others. While Wayland may be the future, it really is in future. At least for Ubuntu 17.10. The […]

Read More

Touchpad stops working after sleep + resume (Fedora 26 on Dell XPS)

After recently upgrading my Dell XPS 13 w/Touchscreen to Fedora 26, the touchpad suddenly stopped working upon resuming from sleep mode. It was reproduced 100% of the time, and required a complete restart in order to get the touchpad working again. There have been several forum posts and bug reports regarding others experiencing these exact […]

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

Tweeter button Facebook button Myspace button