Bug #75411 [Ana->Nab]: --disable-all does not disable SAPIs on Unix builds

From: Date: Fri, 16 Jul 2021 14:23:08 +0000
Subject: Bug #75411 [Ana->Nab]: --disable-all does not disable SAPIs on Unix builds
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235087@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75411&edit=1

 ID:                 75411
 Updated by:         cmb@php.net
 Reported by:        ben at hakim dot co dot il
 Summary:            --disable-all does not disable SAPIs on Unix builds
-Status:             Analyzed
+Status:             Not a bug
 Type:               Bug
 Package:            *General Issues
 Operating System:   Unix
 PHP Version:        7.1.10
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

$ ./configure --help | grep disable-all
  --disable-all           Disable all extensions which are enabled by default


Previous Comments:
------------------------------------------------------------------------
[2017-10-22 21:21:33] ben at hakim dot co dot il

I understand
but what about the bug that I use "--disable-all" and it's enable php-cgi and phpdbg?
it should be fixed...

------------------------------------------------------------------------
[2017-10-22 02:15:24] kalle@php.net

Hi

Yes, thats true it would make the binary sizes smaller and logically make sense as we are talking
about shared code between the different modules/SAPIs. However it is not possible currently, and
most likely never will be, as the code base is built up around the fact that these extensions always
are available, either way it would require "standard" to then depend on each of those
modules anyway.

If you are interesting in working out a solution to change this, then I won't hold you and you
are welcome to start a thread about it on internals@, but it is not relevant to this bug report, as
the extensions part is a part of the current design.

------------------------------------------------------------------------
[2017-10-22 00:19:20] spam2 at rhsoft dot net

"These are some of the essential extensions we have decided that every install of PHP should
have" is one thing and only means they need to be loaded  but that does not imply you need them
statically in all SAPI's

in a package build it's no problem build them shared, include the extensions in php-common and
ship a /etc/php.d/ ini-snippet which only means all the built SAPI's are smaller and share the
so-files instead have the binary code duplicated multiple times

it's practically the same as mysqli can't work without mysqlnd and hence
/etc/php.d/mysql.ini contains these lines

extension = "mysqlnd.so"
extension = "mysqli.so"

the difference is that these 286KB are shared between /usr/lib64/httpd/modules/libphp7.so and
/usr/bin/php instead both binaries 286KB larger

-rwxr-xr-x 1 root root 286K 2017-10-21 02:57 /usr/lib64/php/modules/mysqlnd.so

------------------------------------------------------------------------
[2017-10-21 23:33:36] kalle@php.net

@ben

1) The bug is that --disable-all does not work on SAPIs, so thats why its not working.

2) No, SPL and reflection will not be made possible to be disabled

@reindl

No, SPL and Reflection will not be made possible to be compiled as shared, because, like I stated
earlier, they are built-into the Core. These are some of the essential extensions we have decided
that every install of PHP should have. Some extensions, tho not specifically mentioned, pcre, is
used in the Windows implementation of mail(), the get_browser() function just to name one.

If we were to take out SPL for example, then in the next major version there would be no way to
autoload classes/interfaces/traits, as the __autoload procedural function is going away, thats not
cool.

Instead see these modules as part of the same, tho maybe confusing at first but they are what makes
PHP, well PHP!

------------------------------------------------------------------------
[2017-10-21 20:34:01] spam2 at rhsoft dot net

and can at least spl and reflection be also changed to support shared module build which makes a lot
of sense for machines running a webserver as well as cli scripts

libphp7.so and /usr/bin should be only a tiny wrapper loading shared modules instead both contain a
large part identical binary code

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=75411


--
Edit this bug report at https://bugs.php.net/bug.php?id=75411&edit=1


Thread (9 messages)

« previous php.bugs (#235087) next »