php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43032 installation of /usr/local/apache2/modules/libphp5.so fails
Submitted: 2007-10-19 10:21 UTC Modified: 2010-03-17 09:55 UTC
From: mamfelt at acm dot org Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.2.13 OS: AIX 5.3 TL07 and AIX 6.1
Private report: No CVE-ID: None
 [2007-10-19 10:21 UTC] mamfelt at acm dot org
Description:
------------
The last part of make install fails, no php5 libraries are installed into /usr/lib/apache2/modules. Further, the file libs/libphp5.so is not built either.

Note: regarding the following code: (in /usr/local/apache2/build/instdso.sh)

if test "$SYS" = "AIX"
then
    # on AIX, shared libraries remain in storage even when
    # all processes using them have exited; standard practice
    # prior to installing a shared library is to rm -f first
    CMD="rm -f $TARGETDIR/$TARGET_NAME"
    echo $CMD
    $CMD || exit $?
fi

The command you should consider is:
slibclean (Shared Library Clean) to cleanup shared memory.




Reproduce code:
---------------
michael@x054:[/home/michael/prj/php-5.2.4]make install
        echo '\
\
Installing PHP SAPI module:       apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
rm -f /usr/local/apache2/modules/libphp5.so
/usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/
cp .libs/libphp5.a /usr/local/apache2/modules/libphp5.a
cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/michael/prj/php-5.2.4/libs'
chmod 755 /usr/local/apache2/modules/libphp5.so
chmod: /usr/local/apache2/modules/libphp5.so: A file or directory in the path name does not exist.
apxs:Error: Command failed with rc=65536
.
make: 1254-004 The error code from the last command is 1.


Stop.


Expected result:
----------------
The correct files installed in /usr/local/apache2/modules

Actual result:
--------------
michael@x054:[/home/michael/prj/php-5.2.4]ls -l libs
total 41152
-rw-r--r--   1 root     system     21062992 Oct 19 11:16 libphp5.a
-rw-r--r--   1 root     system         1209 Oct 19 11:16 libphp5.la

michael@x054:[/home/michael/prj/php-5.2.4]ls -l /usr/local/apache2/modules
total 984
-rw-r--r--   1 root     system         8951 Oct 19 10:25 httpd.exp
-rwxr-xr-x   1 root     system        90560 Oct 19 10:26 mod_cgi.so
-rwxr-xr-x   1 root     system        64654 Oct 19 10:26 mod_headers.so
-rwxr-xr-x   1 root     system        56795 Oct 19 10:26 mod_info.so
-rwxr-xr-x   1 root     system       190456 Oct 19 10:27 mod_rewrite.so
-rwxr-xr-x   1 root     system        40889 Oct 19 10:27 mod_speling.so


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-22 08:19 UTC] jani@php.net
See bug #39197

 [2010-03-17 09:51 UTC] mamfelt at acm dot org
This problem is still "out there". I have just traced back and re-read bugs http://bugs.php.net/bug.php?id=39187 and http://bugs.php.net/bug.php?id=39197 which seem to place the blame the linkers or not using GNU tools.
I also found an interesting comment on linux_questions - see comment #5 - http://www.linuxquestions.org/questions/showthread.php?p=3607362#post3607362

where he comments on the rm -f logic.

It saddens me to read that PHP, or some of the PHP people who respond to these regard AIX as "under them", that the world only exist in Linux and GNU (at least that is the impression I have after re-reading the posts.

GNU-tools are not the only tools. PHP is open-source only because I can download it. So, I post today in the hope that perceptions have changed enough that a bug is not marked bogus just because someone is taking the time and effort to port to AIX.

By the way - I am trying to build an installable package. Not all, but most GNU tools use the variable DESTDIR to instruct Makefile to install in a alternate location. (Some projects use BUILD_DIR).

The "problem" of shared libraries should not be a consideration - perhaps a warning to be safe - when INSTALL_ROOT is being used. And my comment from 2007 is still true regarding clearing out shared library code. rm -f does not clear memory, only slibclean does.

For the "demonstration" I removed the @ in the install-sapi section of Makefile to see the actual commands performed. The file it has just installed is being removed. This is still a bug. And if it works for you - I wonder how you set your system up - because I installed a system specifically to build packages so that idiosyncrancies of my main server would not be confusing matters.

===========
root@x105:[/data/prj/php-5.2.13]INSTALL_ROOT=/data/prj/php5.2.13.apache2.sapi                                    
root@x105:[/data/prj/php-5.2.13]export INSTALL_ROOT                                                              
root@x105:[/data/prj/php-5.2.13]make install-sapi                            
Installing PHP SAPI module:       apache2handler
        /data/prj/php-5.2.13/build/shtool mkdir -p /data/prj/php5.2.13.apache2.sapi/usr/local/bin
        if test ! -r /data/prj/php-5.2.13/libs/libphp5.so; then  for i in 0.0.0 0.0 0; do  if test -r /data/prj/php-5.2.13/libs/libphp5.so.$i; then  ln -s /data/prj/php-5.2.13/libs/libphp5.so.$i /data/prj/php-5.2.13/libs/libphp5.so;  break;  fi;  done;  fi
        /data/prj/php-5.2.13/build/shtool mkdir -p '/data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules' && /data/prj/php-5.2.13/build/shtool mkdir -p '/data/prj/php5.2.13.apache2.sapi/usr/local/apache2/conf' && /usr/local/apache2/bin/apxs -S LIBEXECDIR='/data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules' -S SYSCONFDIR='/data/prj/php5.2.13.apache2.sapi/usr/local/apache2/conf' -i -a -n php5 libphp5.la
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules
rm -f /data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules/libphp5.so
/usr/local/apache2/build/libtool --mode=install cp libphp5.la /data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules/
cp .libs/libphp5.a /data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules/libphp5.a
cp .libs/libphp5.lai /data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /data/prj/php-5.2.13/libs'
chmod 755 /data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules/libphp5.so
chmod: /data/prj/php5.2.13.apache2.sapi/usr/local/apache2/modules/libphp5.so: A file or directory in the path name does not exist.
apxs:Error: Command failed with rc=65536
.
make: 1254-004 The error code from the last command is 1.


Stop.
===============
Note: I'll resolve this by disabling the rm -f command, just as I did in 2007. I still request (actually recommend again) that you look at the logic and consider slibclean if the goal is to clear memory. And to do it before the copy is made, rather than after.
 [2010-03-17 09:52 UTC] mamfelt at acm dot org
The bug is still marked bogus - curious if this ever changes.
 [2010-03-17 09:55 UTC] mamfelt at acm dot org
And now my apology - as it is not PHP, but apache code in error.

So, hopefully, this will just lie here and be googled by other people trying to resolve this problem.

Not a PHP bug!! my bad :(
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 11 05:01:27 2024 UTC