Opened 15 years ago

Closed 15 years ago

#21281 closed defect (fixed)

php4, php52, php5, php5-devel: +apache2 +fastcgi fails to install and php5 modules fail to work if using apache2 +workermpm

Reported by: james.applemac@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: workermpm Cc: jyrkiwahlstedt, artrigue@…
Port: php4, php52, php5, php5-devel

Description (last modified by ryandesign (Ryan Carsten Schmidt))

OS:Mac OS X 10.6
xcode:3.2
apache2.2.13_2 build with variants:+darwin+openldap+workermpm

port install php5 +apache2 +fastcgi +ipc +pear +snmp +suhosin
Port command started with PID 47556
--->  Computing dependencies for php5
--->  Fetching gawk
--->  Verifying checksum(s) for gawk
--->  Extracting gawk
--->  Configuring gawk
--->  Building gawk
--->  Staging gawk into destroot
--->  Installing gawk @3.1.7_0
--->  Activating gawk @3.1.7_0
--->  Cleaning gawk
--->  Fetching autoconf213
--->  Verifying checksum(s) for autoconf213
--->  Extracting autoconf213
--->  Configuring autoconf213
--->  Building autoconf213
--->  Staging autoconf213 into destroot
--->  Installing autoconf213 @2.13_1
--->  Activating autoconf213 @2.13_1
--->  Cleaning autoconf213
--->  Fetching gsed
--->  Verifying checksum(s) for gsed
--->  Extracting gsed
--->  Configuring gsed
--->  Building gsed
--->  Staging gsed into destroot
--->  Installing gsed @4.2.1_0
--->  Activating gsed @4.2.1_0
--->  Cleaning gsed
--->  Fetching mhash
--->  Verifying checksum(s) for mhash
--->  Extracting mhash
--->  Configuring mhash
--->  Building mhash
--->  Staging mhash into destroot
--->  Installing mhash @0.9.9.9_0
--->  Activating mhash @0.9.9.9_0
--->  Cleaning mhash
--->  Fetching php5
--->  Verifying checksum(s) for php5
--->  Extracting php5
--->  Applying patches to php5
--->  Configuring php5
--->  Building php5
--->  Staging php5 into destroot
--->  Configuring php5 again for fastcgi
--->  Building php5 again for fastcgi
Error: Target org.macports.destroot returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_php5/work/php-5.3.0" && /usr/bin/make all " returned error 2
Command output:       _php_print_info in info.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
  "_core_globals", referenced from:
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
  "_compiler_globals", referenced from:
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
Error: Status 1 encountered during processing.
--->  Executing: /opt/local/bin/port install php5 +apache2 +fastcgi +ipc +pear +snmp +suhosin

Change History (14)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Cc: jwa@… added
Owner: changed from macports-tickets@… to ryandesign@…
Port: php5 added; PHP5 removed

comment:2 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Status: newassigned
Summary: PHP 5.3.0_2 build failed under Mac OS X 10.6php5 5.3.0_2 undefined symbols _core_globals, _sapi_cgi_activate

I would need to see more output ("sudo port -d install php5") to be sure, but I believe php5 is not compatible with apache2's +workermpm variant. I think this is the same problem as #16596 and this mailing list post. Please confirm whether using apache2's default +preforkmpm variant instead fixes the problem.

comment:3 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: php5 5.3.0_2 undefined symbols _core_globals, _sapi_cgi_activatephp5 +apache2 +fastcgi fails if using apache2 +preforkmpm

I can now confirm the problem, which only exists when apache2 is compiled with the preforkmpm variant and php5 is compiled with both the apache2 and fastcgi variants. Using either the apache2 or the fastcgi variants by themselves compiles fine, but together:

Undefined symbols:
  "_sapi_globals", referenced from:
      _php_print_info in info.o
      _php_print_info in info.o
      _php_print_info in info.o
      _sapi_cgi_read_post in cgi_main.o
      _sapi_cgi_send_headers in cgi_main.o
      _sapi_cgibin_getenv in cgi_main.o
      _sapi_cgi_deactivate in cgi_main.o
      _sapi_cgibin_ub_write in cgi_main.o
      __sapi_cgibin_putenv in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_log_message in cgi_main.o
      _sapi_cgi_register_variables in cgi_main.o
      _sapi_cgi_register_variables in cgi_main.o
  "_executor_globals", referenced from:
      _php_print_gpcse_array in info.o
      _php_print_info in info.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
  "_core_globals", referenced from:
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _cgi_php_import_environment_variables in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
      _sapi_cgi_activate in cgi_main.o
  "_compiler_globals", referenced from:
      _main in cgi_main.o
      _main in cgi_main.o
      _main in cgi_main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

To build the php fastcgi binary when the php apache2 module has already been built, I just issue "make" again, which I assume fails in this case because the apache2 module was built with Zend Thread Safety ("zts") while the fastcgi binary is wanting to be built without it ("non-zts"). I could fix that by using "make clean" before building fastcgi, but it still leaves the problem that you would be installing different php parts which are not compatible with one another. In particular, all the php modules you'd want to install separately would only work for one or the other (either the apache2 module or the fastcgi binary) but not both because they would have different extensions directories. And I'm not sure how the php cli would react either.

My current thought is that I should prevent the installation of the php apache module if apache has not been compiled with its default preforkmpm variant.

I did not test what happens when using apache2's third mpm variant, eventmpm.

comment:4 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: artrigue@… added

I'm marking #16596 as a duplicate of this one because although it came first, this one is clearer and gets right to the point.

comment:5 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: workermpm added
Summary: php5 +apache2 +fastcgi fails if using apache2 +preforkmpmphp5 +apache2 +fastcgi fails if using apache2 +workermpm

comment:6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

I also edited my prior comment to fix my mixup between preforkmpm and workermpm, sorry.

comment:7 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

See also #20527.

comment:8 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: php5 +apache2 +fastcgi fails if using apache2 +workermpmphp5 +apache2 +fastcgi fails to install and php5 modules fail to work if using apache2 +workermpm

Has duplicates #21573, #21574, #21575. These are a little different: php5 modules compile but don't work if apache2 was installed with +workermpm. So the problem is not just limited to combining the +apache2 and +fastcgi variants of php5; even just using +apache2 you will have problems with modules. So we really should prevent installation of php5 +apache2 unless apache2 was installed with +preforkmpm.

comment:9 Changed 15 years ago by james.applemac@…

So, at this time, apache2 with workermpm cannot work with all php5-* packages in Macport 1.8 ? Am I right?

comment:10 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

That seems to be correct. At least, the ones you tested don't seem to work.

The #1 FAQ on the PHP installation page is "Why shouldn't I use Apache2 with a threaded MPM in a production environment?" so I don't feel too badly about my plan to prevent this from being possible at all. Granted most MacPorts users are probably running a development server, not a production server, but still, why do you need a threaded web server on your development machine?

comment:11 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

  • r58589: php5 +apache2 now prevents installation if apache2 is not installed with +preforkmpm. Still need to update php5-devel, php52, and php4 with this change.

comment:12 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

  • r58830: updated php5-devel with this change

comment:13 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

  • r58833: updated php52 with this change

comment:14 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Port: php4 php52 php5-devel added
Resolution: fixed
Status: assignedclosed
Summary: php5 +apache2 +fastcgi fails to install and php5 modules fail to work if using apache2 +workermpmphp4, php52, php5, php5-devel: +apache2 +fastcgi fails to install and php5 modules fail to work if using apache2 +workermpm
  • r58844: updated php4 with this change.
Note: See TracTickets for help on using tickets.