php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25767 Apache will not start with PHP Modules
Submitted: 2003-10-06 15:00 UTC Modified: 2003-10-07 19:51 UTC
From: colin dot harford at ualberta dot ca Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.4RC1 OS: OpenBSD -current
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: colin dot harford at ualberta dot ca
New email:
PHP Version: OS:

 

 [2003-10-06 15:00 UTC] colin dot harford at ualberta dot ca
Description:
------------
Machine Information:

# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd3.4/2.95.3/specs
gcc version 2.95.3 20010125 (prerelease, propolice)

i386 running OpenBSD with Apache 2.0.47.

I have the same problem with PHP-4.3.3 and PHP-4.3.4-RC1

PHP is compiled with:  ./configure --enable-sockets --with-mysql=/opt/db/mysql/ --with-apxs2=/opt/apache2/bin/apxs


What happens, is that when I have the lines:
LoadModule php4_module        modules/libphp4.so
AddType application/x-httpd-php .php
 
in my httpd.conf.  If the lines are uncommented, apache will start.

I changed apache debug level to debug, however, there is no errors on screen or in the error_log.  

I have tried both php.ini-dist and php.ini-recommended.   Neither of which have any effect on it.

What I was expecting quite simply is for apache and php to load.  I have rebuilt apache and php to new locations as well, ran make distcleans before doing the installs.  



Thanks,


CH


FYI only with snapshost:

I tried to compile the snapshot, but run into errors with that.  FYI only, it is:

(external!/opt/php4-200310061730)
# make
/bin/sh /opt/php4-200310061730/libtool --silent --preserve-dup-deps --mode=link gcc -export-dynamic -g -O2  -avoid-version -module -L/opt/db/mysql//lib/mysql  -R /opt/db/mysql//lib/mysql ext/ctype/ctype.lo ext/mysql/php_mysql.lo ext/overload/overload.lo ext/pcre/pcrelib/maketables.lo ext/pcre/pcrelib/get.lo ext/pcre/pcrelib/study.lo ext/pcre/pcrelib/pcre.lo ext/pcre/php_pcre.lo ext/posix/posix.lo ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo ext/sockets/sockets.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo ext/tokenizer/tokenizer.lo ext/xml/xml.lo ext/xml/expat/xmlparse.lo ext/xml/expat/xmlrole.lo ext/xml/expat/xmltok.lo regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/streams.lo main/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo main/memory_streams.lo main/user_streams.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lmysqlclient -lm  -o sapi/cli/php
ext/standard/filestat.lo: In function `php_stat':
/opt/php4-200310061730/ext/standard/filestat.c:575: undefined reference to `php_check_open_basedir_ex'
collect2: ld returned 1 exit status
*** Error code 1

Stop in /opt/php4-200310061730 (line 169 of Makefile).



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-06 18:25 UTC] sniper@php.net
Use this snapshot, and EXACTLY this one: 
http://snaps.php.net/php4-STABLE-latest.tar.gz

And make sure those 2 lines are the 2 LAST lines in your httpd.conf.

If this still fails, start apache in gdb:

# gdb httpd
(gdb) r -DONE_PROCESS

Then you might see more what's going on.

 [2003-10-06 19:05 UTC] colin dot harford at ualberta dot ca
Installed the new snapshot... Installs fine...

Apache still won't start

(gw!/opt/apache2/bin) [root-ttyp3]
# gdb httpd 
GNU gdb 4.16.1
Copyright 1996 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public 
License, and you are
welcome to change it and/or distribute copies of it 
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show 
warranty" for details.
This GDB was configured as "i386-unknown-openbsd3.4"...
(gdb) r -DONE_PROCESS
Starting program: /opt/apache2/bin/httpd -DONE_PROCESS

Program exited with code 04.


CH
 [2003-10-06 21:16 UTC] sniper@php.net
Are you sure the error is not outputted elsewhere, like syslog?


 [2003-10-06 21:18 UTC] sniper@php.net
you should also try strace on httpd:

# strace httpd -X -DONE_PROCESS 

You can then see where it bails out.

 [2003-10-06 21:50 UTC] colin dot harford at ualberta dot ca
There is nothing in /var/log: I set syslog to log 
everything to /var/log/all as well as everywhere else, 
and nothing was placed there.


I can't run strace, as it doesn't exist for OpenBSD.  
However, I did run a ktrace, which is similar ktrace ./
httpd -X -DONE_PROCESS.  The kdump of it is quite long, 
so I placed it on: http://www.ualberta.ca/~charford/
log.txt

Thanks,


CH
 [2003-10-07 04:04 UTC] sniper@php.net
Not sure but I think it's just missing path in LD_LIBRARY_PATH..check what this outputs:

# ldd libphp4.so

 [2003-10-07 11:00 UTC] colin dot harford at ualberta dot ca
(gw!/opt/apache2/modules) [root-ttyp2]
# ldd libphp4.so
libphp4.so:
libphp4.so: Exec format error
libphp4.so: exit status 1


hmmmm.


CH
 [2003-10-07 16:23 UTC] colin dot harford at ualberta dot ca
# objdump -p libphp4.so

libphp4.so:     file format elf32-i386

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x000fc450 memsz 0x000fc450 flags r-x
    LOAD off    0x000fd000 vaddr 0x20000000 paddr 0x20000000 align 2**12
         filesz 0x000274e0 memsz 0x000274e0 flags r--
    LOAD off    0x001244e0 vaddr 0x200284e0 paddr 0x200284e0 align 2**12
         filesz 0x0000d248 memsz 0x0000d248 flags rw-
    LOAD off    0x00131728 vaddr 0x20036728 paddr 0x20036728 align 2**12
         filesz 0x00001408 memsz 0x00001408 flags rw-
    LOAD off    0x00132b30 vaddr 0x20038b30 paddr 0x20038b30 align 2**12
         filesz 0x00000088 memsz 0x00005024 flags rw-
 DYNAMIC off    0x00132b30 vaddr 0x20038b30 paddr 0x20038b30 align 2**2
         filesz 0x00000088 memsz 0x00000088 flags rw-

Dynamic Section:
  NEEDED      libmysqlclient.so.12.0
  NEEDED      libm.so.1.0
  INIT        0x24770
  FINI        0x247a0
  HASH        0x134
  STRTAB      0xc998
  SYMTAB      0x42f8
  STRSZ       0x93e8
  SYMENT      0x10
  PLTGOT      0x20036728
  PLTRELSZ    0x2210
  PLTREL      0x11
  JMPREL      0x1e098
  REL         0x15d80
  RELSZ       0x8318
  RELENT      0x8



I have put up the config.log from that STABLE-snapshot at 

http://www.ualberta.ca/~charford/config.log
 [2003-10-07 19:01 UTC] sniper@php.net
Is the path to that mysql lib in your LD_LIBRARY_PATH or not?


 [2003-10-07 19:48 UTC] colin dot harford at ualberta dot ca
In my rc.conf:

shlib_dirs=/opt/db/mysql/lib/mysql/                     
# extra directories for ldconfig, separated
# by space


# ldconfig -r | grep mysql
        search directories: /usr/lib:/usr/X11R6/lib:/
usr/local/lib:/opt/db/mysql/lib/mysql:/opt/apache2/lib:/
opt/php-4.3.3/libs:/opt/php-4.3.4RC1/libs:/opt/php4-
STABLE-200310062130/libs

Which I thought was odd, as I know that mysql was 
working so I did an 

ldconfig -R ldconfig -R /opt/db/mysql /opt/db/mysql/lib/
mysql/

Then when I did a:

# ldconfig -r | grep mysql
        search directories: /usr/lib:/usr/X11R6/lib:/
usr/local/lib:/opt/apache2/lib:/opt/php-4.3.3/libs:/opt/
php-4.3.4RC1/libs:/opt/php4-STABLE-200310062130/libs:/
opt/db/mysql/lib:/opt/db/mysql/lib/mysql
        130:-lmysqlclient.12.0 => /opt/db/mysql/lib/
mysql/libmysqlclient.so.12.0c

Then, I tried to start apache, and ran into some errors 
about not enough space, which I traced to some 
semaphores still in use by apache.  Killing them off I 
was able to start apache and php works.


Thanks for your help.


CH


FYI:

ldd still comes up like:

# ldd libphp4.so 
libphp4.so:
libphp4.so: Exec format error
libphp4.so: exit status 1
 [2003-10-07 19:51 UTC] sniper@php.net
Not PHP bug -> bogus. (I'm glad you solved it :)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 08:01:32 2024 UTC