php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41102 Unable to compile as static apache module
Submitted: 2007-04-16 13:43 UTC Modified: 2007-04-24 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: nobody at example dot org Assigned:
Status: No Feedback Package: *Compile Issues
PHP Version: 5.2.2RC1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nobody at example dot org
New email:
PHP Version: OS:

 

 [2007-04-16 13:43 UTC] nobody at example dot org
Description:
------------
I'm unable to compile 5.2.2RC1 as an Apache module on a specific machine/configuration. Neither PHP_LIBS or PHP_CFLAGS are present in apache src/modules/php5/Makefile 

Even after manually adding include paths and libs to EXTRA_* in the makefile, build fails at linker stage.

Problem system has:
autoconf (GNU Autoconf) 2.59
gcc version 3.3.4

Successfully compiled on another system with:
autoconf (GNU Autoconf) 2.61
gcc version 3.4.6


Reproduce code:
---------------
# Manual additions to /src/modules/php5/Makefile
EXTRA_LIBS=-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5 \
-lcrypt -lz -ldl -lm -lxml2
EXTRA_INCLUDES=-I../../../../php-5.2.2RC1/main -I../../../../php-5.2.2RC1/Zend \
-I../../../../php-5.2.2RC1/sapi/apache -I../../../../php-5.2.2RC1/ \
-I../../../../php-5.2.2RC1/TSRM


Expected result:
----------------
Clean compile.

Actual result:
--------------
modules.o(.data+0x44): undefined reference to `php5a_module'
modules.o(.data+0xa4): undefined reference to `php5a_module'
collect2: ld returned 1 exit status

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-16 13:53 UTC] tony2001@php.net
Not reproducible.
 [2007-04-16 14:04 UTC] nobody at example dot org
> Not reproducible.

It is on the machine I'm attempting to build on - running Slackware 10.0. 

The same machine built a PHP5.1 static module without error.
 [2007-04-16 14:48 UTC] tony2001@php.net
>It is on the machine I'm attempting to build on 
Great, but I apparently don't have your machine so I need to know how to reproduce it on my machine.
 [2007-04-16 16:50 UTC] nobody at example dot org
> Great, but I apparently don't have your machine so I need to 
> know how to reproduce it on my machine.

++Great

If I knew enough about the PHP & Apache build processes to tell you that, surely I'd be contributing a patch instead of filing a bug report?  

AFAIK, the Apache build process has not changed and the PHP cli installs without error. (related?) problems occur only when compiling Apache with PHP as a static module.

Problem #1

The info in libphp5.module is not being transferred to the generated $APACHE/src/modules/php5/Makefile although the file libphp5.module is present in that dir. I've verified these exact tarballs build a static PHP module on another system without error (as previously noted) and was able to manually edit the Makefile.

Problem #2

After manually editing the Makefile, Apache build still fails with this linker error: 

modules.o(.data+0x44): undefined reference to `php5a_module'
modules.o(.data+0xa4): undefined reference to `php5a_module'
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/home/build/src/apache-1.3/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/home/build/src/apache-1.3'
make: *** [build] Error 2
 [2007-04-16 16:58 UTC] tony2001@php.net
What EXACTLY are you doing and what do I need to do in order to reproduce it?
Please describe all the steps.
 [2007-04-16 17:48 UTC] nobody at example dot org
aclocal (GNU automake) 1.8.5
gcc version 3.3.4
GNU ld version 2.15.90.0.3 

Apache (1.3 dev snapshot)
PHP-5.2.2RC1

Tarballs verified to compile successfully on a desktop machine running another (more up-to-date) distro.

cd src/apache-1.3
./configure --prefix=/srv/www
cd ../php-5.2.2RC1
./configure --disable-cgi --disable-ipv6 --disable-short-tags \
--with-apache=../apache-1.3 --with-gnu-ld --with-zend-vm=GOTO
make
su
make install
exit
cd ../apache-1.3
./configure --activate-module=src/modules/php5/libphp5.a \
--enable-module=rewrite --prefix=/srv/www
make
...
===> src/modules/php5
gcc -c  -I../../os/unix -I../../include   -DLINUX=22 -DHAVE_SET_DUMPABLE -DNO_DBM_REWRITEMAP -DUSE_HSREGEX -DNO_DL_NEEDED -O2 -fomit-frame-pointer -pipe `../../apaci`    mod_php5.c
mod_php5.c:22:29: php_apache_http.h: No such file or directory
In file included from mod_php5.c:23:
../../include/http_conf_globals.h:28: error: syntax error before "int"
../../include/http_conf_globals.h:29: error: syntax error before "int"
[Many errors as you can imagine]

src/modules/php5/Makefile doesn't contain paths and lib info from src/modules/php5/libphp5.module

I Manually insert PHP_CFLAGS and PHP_LIBS from that file in to the Makefile. Then resume

make 
===> src
make[1]: Entering directory `/home/build/apache-1.3'
make[2]: Entering directory `/home/build/apache-1.3/src'
===> src/regex
make[3]: Nothing to be done for `all'.
<=== src/regex
===> src/os/unix
make[3]: Nothing to be done for `all'.
<=== src/os/unix
===> src/ap
make[3]: Nothing to be done for `all'.
<=== src/ap
===> src/main
make[3]: Nothing to be done for `all'.
<=== src/main
===> src/lib
<=== src/lib
===> src/modules
===> src/modules/standard
make[4]: Nothing to be done for `all'.
<=== src/modules/standard
===> src/modules/php5
gcc -c  -I../../os/unix -I../../include   -DLINUX=22 -DHAVE_SET_DUMPABLE -DNO_DBM_REWRITEMAP -DUSE_HSREGEX -DNO_DL_NEEDED -O2 -fomit-frame-pointer -pipe `../../apaci` -I/home/build/php-5.2.2RC1/main -I/home/build/php-5.2.2RC1/Zend -I/home/build/php-5.2.2RC1/TSRM -I/home/build/php-5.2.2RC1 -I/home/build/php-5.2.2RC1/sapi/apache -I/home/build/php-5.2.2RC1/main -I/home/build/php-5.2.2RC1/Zend -I/home/build/php-5.2.2RC1/TSRM   mod_php5.c
cp libmodphp5.a libphp5.
ar r libphp5. mod_php5.o
ranlib libphp5.
cp libphp5. libphp5.a
<=== src/modules/php5
<=== src/modules
gcc -c  -I./os/unix -I./include   -DLINUX=22 -DHAVE_SET_DUMPABLE -DNO_DBM_REWRITEMAP -DUSE_HSREGEX -DNO_DL_NEEDED -O2 -fomit-frame-pointer -pipe `./apaci` modules.c
gcc -c  -I./os/unix -I./include   -DLINUX=22 -DHAVE_SET_DUMPABLE -DNO_DBM_REWRITEMAP -DUSE_HSREGEX -DNO_DL_NEEDED -O2 -fomit-frame-pointer -pipe `./apaci` buildmark.c
gcc  -DLINUX=22 -DHAVE_SET_DUMPABLE -DNO_DBM_REWRITEMAP -DUSE_HSREGEX -DNO_DL_NEEDED -O2 -fomit-frame-pointer -pipe `./apaci`    \
      -o httpd buildmark.o modules.o modules/standard/libstandard.a modules/php5/libphp5.a main/libmain.a ./os/unix/libos.a ap/libap.a regex/libregex.a   -lm -lcrypt -lexpat
modules.o(.data+0x44): undefined reference to `php5a_module'
modules.o(.data+0xa4): undefined reference to `php5a_module'
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/home/build/apache-1.3/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/home/build/apache-1.3'
make: *** [build] Error 2
 [2007-04-16 17:56 UTC] tony2001@php.net
>Tarballs verified to compile successfully on a desktop machine
> running another (more up-to-date) distro.

Does this mean the same PHP works fine on another machine?
What do you mean by more up-to-date distro and what distro is that?
 [2007-04-16 18:09 UTC] nobody at example dot org
> Does this mean the same PHP works fine on another machine?

Compiles fine on my laptop.

> What do you mean by more up-to-date distro and what distro is that?

I'm referring to more recent releases of the toolchain.

aclocal (GNU automake) 1.10
gcc version 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.10)
GNU ld version 2.16.1
 [2007-04-16 18:28 UTC] tony2001@php.net
>I'm referring to more recent releases of the toolchain.
Try updating the problematic machine and see which update fixes it.
 [2007-04-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 21:03:16 2021 UTC