php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17977 session can't be built shared with PHP
Submitted: 2002-06-25 13:45 UTC Modified: 2002-06-27 22:45 UTC
From: list at firehawksystems dot com Assigned:
Status: Closed Package: *Compile Issues
PHP Version: 4.2.1 OS: FreeBSD 4.3, but any unix
Private report: No CVE-ID: None
 [2002-06-25 13:45 UTC] list at firehawksystems dot com
I have been trying to build session support as a shared extension and here is what I have found.  It works fine if you us the phpize, ./configure, make method, but if you try building it shared while building PHP it will not work.

./configure --with-layout=GNU --enable-session=shared --with-mm=shared
<snip> (it works)
make
<snip>(while compiling main/internal_functions.c)
internal_functions.c:47: `phpext_ps_mm_ptr' undeclared here (not in a function)
internal_functions.c:47: initializer element is not constant
internal_functions.c:47: (near initialization for `php_builtin_extensions[6]')

--- internal_functions.c ---
zend_module_entry *php_builtin_extensions[] = {
        phpext_xml_ptr,
        phpext_standard_ptr,
        phpext_posix_ptr,
        phpext_pcre_ptr,
        phpext_mysql_ptr,
        phpext_ctype_ptr,
 phpext_ps_mm_ptr,
};


It seems that phpext_ps_mm_ptr gets added if --with-mm or --with-mm=shared is set.  Adding it with  --with-mm=shared is bad as it is not needed and doesn't include the right headers for that function anyway.  I have created a patch to fix this, but wanted to make sure this was the best way to fix it.  Is there a better way? Comments?

Thanks,

Brian

BTW,
  ./configure --with-layout=GNU --enable-session=shared --with-mm=no
and
  ./configure --with-layout=GNU --enable-session=shared --without-mm
will not build it shared either, but I am not worried about that.

---------------- Patch

--- php-4.2.1/configure Mon Jun 24 14:15:58 2002
+++ php-4.2.1/configure Mon Jun 24 14:16:36 2002
@@ -57197,9 +57197,9 @@
 #define HAVE_LIBMM 1
 EOF

-
-  EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS phpext_ps_mm_ptr,"
-
+  if test "$ext_shared" != "yes"; then
+    EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS phpext_ps_mm_ptr,"
+  fi
 fi

 if test "$PHP_SESSION" != "no"; then


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-27 22:45 UTC] sniper@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC