# modules/embedded function and Mac OSX

- Thread: https://externals.io/message/14642
- Original archive: https://news-web.php.net/php.internals/14642
- Started by D.Walsh on 2005-02-04T11:30:06+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #14642 — D.Walsh — 2005-02-04T11:30:06+00:00

URL: https://externals.io/message/14642#14642

I've been having some problems building some modules or embedding the  
function in PHP.

I've attempted to build several different modules and all give the same  
results.

If I build as a module, placing an 'extension='  entry in php.ini  
causes a dylib error.

dyld: /usr/sbin/httpd Undefined symbols:
__array_init
__convert_to_string
__efree
__emalloc
__estrdup
__estrndup
_add_assoc_long_ex
_add_next_index_double
_add_next_index_string
_convert_to_array
_convert_to_long

________________________________________________________________________ 
_


Without the 'extension='  entry in php.ini, placing an entry in my php  
script "dl('module.so');" results in the following log entry:

[Fri Feb  4 06:12:38 2005] [error] PHP Warning:  module:  Unable to  
register functions, unable to load in Unknown on line 0

________________________________________________________________________ 
_


If I use this entry in my php script, the module functions work  
properly.

if (!function_exists('my_function') && @dl('module.so')) {
  }

________________________________________________________________________ 
_


Is there anything specific I need to do for Mac OSX to build modules or  
embed them in PHP so they work properly?

---

## #14643 — Andrei Zmievski — 2005-02-04T19:19:27+00:00

URL: https://externals.io/message/14642#14643 · In reply to: #14642

Make sure it was compiled as a bundle and not as a shared library. There
is a difference. Run this:

  % file <path>

And if it replies "Mach-O dynamically linked shared library ppc", it was
compiled in the wrong way. The latest updates to build system should fix
this automatically.


> I've been having some problems building some modules or embedding the  
> function in PHP.
> 
> I've attempted to build several different modules and all give the same  
> results.
> 
> If I build as a module, placing an 'extension='  entry in php.ini  
> causes a dylib error.
> 
> dyld: /usr/sbin/httpd Undefined symbols:
> __array_init
> __convert_to_string
> __efree
> __emalloc
> __estrdup
> __estrndup
> _add_assoc_long_ex
> _add_next_index_double
> _add_next_index_string
> _convert_to_array
> _convert_to_long
> 
> ________________________________________________________________________ 
> _
> 
> 
> Without the 'extension='  entry in php.ini, placing an entry in my php  
> script "dl('module.so');" results in the following log entry:
> 
> [Fri Feb  4 06:12:38 2005] [error] PHP Warning:  module:  Unable to  
> register functions, unable to load in Unknown on line 0
> 
> ________________________________________________________________________ 
> _
> 
> 
> If I use this entry in my php script, the module functions work  
> properly.
> 
> if (!function_exists('my_function') && @dl('module.so')) {
>  }
> 
> ________________________________________________________________________ 
> _
> 
> 
> Is there anything specific I need to do for Mac OSX to build modules or  
> embed them in PHP so they work properly?
> 
> -- 
> 
> 



- Andrei
