# Issue developing a PHP extension on MacOS X

- Thread: https://externals.io/message/25064
- Original archive: https://news-web.php.net/php.internals/25064
- Started by Marco Bambini on 2006-07-30T11:24:00+00:00
- Messages: 1
- 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

---

## #25064 — Marco Bambini — 2006-07-30T11:24:00+00:00

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

I developed a PHP extension for MacOS X and when loaded from within  
apache+php everything works fine.
The issue occurs every time I try to execute php from the command  
like for example:

php -r "print ini_get('extension_dir');"

then PHP crashes and I got a dylib error:

dyld: lazy symbol binding failed: Symbol not found: ZEND_ROUTINE_HERE
   Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20020429/ 
rsql.dylib
   Expected in: flat namespace

dyld: Symbol not found: ZEND_ROUTINE_HERE
   Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20020429/ 
rsql.dylib
   Expected in: flat namespace

please note that ZEND_ROUTINE_HERE is the first routine I use in the  
dylib entrypoint PHP_MINIT_FUNCTION.

Something is wrong, but I really do not understand how I can solve  
the issue because as I already said when loaded from within apache  
everything works fine without any error.

The dylib is generated with the following parameters to gcc:
-dynamic -flat_namespace -bundle -undefined suppress

  I tried also to modify these flags to:
-dynamic -twolevel_namespace -bundle -bundle_loader /usr/bin/php

but nothing changed.

Please help.
---
Thanks a lot,
Marco Bambini
Italy
