Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Mac OS X 10.7.5

I can't install phalcon in Zend Server or MAMP in my Mac OS X 10.7.5

The PHP version in Zend Server is 5.3.14 and the result is: phalcon The system could not load this extension

I'm using too MAMP with PHP version 5.4.10

The steps for install:

Pixel-Consulting:extension_new oscarpina$ git clone git:// Cloning into 'cphalcon'... remote: Counting objects: 16683, done. remote: Compressing objects: 100% (3698/3698), done. remote: Total 16683 (delta 12463), reused 16520 (delta 12325) Receiving objects: 100% (16683/16683), 11.55 MiB | 355 KiB/s, done. Resolving deltas: 100% (12463/12463), done. Pixel-Consulting:extension_new oscarpina$ cd cphalcon/build Pixel-Consulting:build oscarpina$ sudo ./install Password: Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 warning: prefer named diversions warning: prefer named diversions checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for icc... no checking for suncc... no checking whether gcc and cc understand -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... i386-apple-darwin11.4.2 checking host system type... i386-apple-darwin11.4.2 checking target system type... i386-apple-darwin11.4.2 checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20090626 checking for PHP installed headers prefix... /usr/include/php checking if debug is enabled... no checking if zts is enabled... no checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... no checking for nawk... no checking for awk... awk checking if awk is broken... no checking whether to enable phalcon framework... yes, shared checking for ld used by gcc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm checking whether ln -s works... yes checking how to recognize dependent libraries... pass_all checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking the maximum length of command line arguments... 196608 checking command to parse /usr/bin/nm output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking for dsymutil... dsymutil checking for nmedit... nmedit checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fno-common checking if gcc PIC flag -fno-common works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin11.4.2 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no

creating libtool appending configuration tag "CXX" to libtool configure: creating ./config.status config.status: creating config.h /bin/sh /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/libtool --mode=compile gcc -I. -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits -DPHP_ATOM_INC -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/include -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/main -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -fno-delete-null-pointer-checks -finline-functions -fomit-frame-pointer -march=core2 -c /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/phalcon.c -o phalcon.lo mkdir .libs gcc -I. -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits -DPHP_ATOM_INC -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/include -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/main -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -fno-delete-null-pointer-checks -finline-functions -fomit-frame-pointer -march=core2 -c /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/phalcon.c -fno-common -DPIC -o .libs/phalcon.o /bin/sh /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/libtool --mode=link gcc -DPHP_ATOM_INC -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/include -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/main -I/Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -fno-delete-null-pointer-checks -finline-functions -fomit-frame-pointer -march=core2 -o -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/modules phalcon.lo gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/ -bundle .libs/phalcon.o -march=core2 dsymutil .libs/ || : warning: no debug symbols in executable (-arch x86_64) creating (cd .libs && rm -f && ln -s ../ /bin/sh /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/libtool --mode=install cp ./ /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/modules cp ./.libs/ /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/modules/ cp ./.libs/phalcon.lai /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/modules/

Libraries have been installed in: /Users/oscarpina/pau/DEVEL/extension_new/cphalcon/build/64bits/modules

If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:

  • add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable during execution

See any operating system documentation about shared libraries for more information, such as the ld(1) and manual pages.

Build complete. Don't forget to run 'make test'.

Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20090626/

Thanks for compiling Phalcon! Build succeed: Please restart your web server to complete the installation

I've configured php.ini but I can't load phalcon extension : (

Did you use


in your php.ini?


Yes, and I re-start web server:

Pixel-Consulting:build oscarpina$ sudo /usr/local/zend/bin/ restart Password: Stopping Deployment [OK] Starting Deployment [OK] [19.04.2013 20:10:58 SYSTEM] watchdog for zdd is running. [19.04.2013 20:10:58 SYSTEM] zdd is running. Stopping Zend Server Monitor node [OK] Starting Zend Server Monitor node [OK] [19.04.2013 20:11:05 SYSTEM] watchdog for monitor is running. [19.04.2013 20:11:05 SYSTEM] monitor is running. /usr/local/zend/bin/apachectl stop [OK] /usr/local/zend/bin/apachectl start [OK] Stopping Zend Server GUI [Lighttpd] [OK] spawn-fcgi: child spawned successfully: PID: 14481 Starting Zend Server GUI [Lighttpd] [OK] Stopping Java bridge [OK] Starting Java bridge [OK] Stopping JobQueue [OK] Starting JobQueue [OK] [19.04.2013 20:11:19 SYSTEM] watchdog for jqd is running. [19.04.2013 20:11:19 SYSTEM] jqd is running.


I've found in logs the problem:

[19-Apr-2013 18:11:07 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/, 9): no suitable image found. Did find: /usr/lib/php/extensions/no-debug-non-zts-20090626/ mach-o, but wrong architecture in Unknown on line 0

Try to find where is located. From what you posted in the first post it should be here:


Alternatively (because I do not know much about OSX) it might be the case with the actual compilation libraries. I will let @phalcon chime in on this since he is the one with the Mac


Thanks for your fast reply. My is located in:

Pixel-Consulting:~ oscarpina$ cd /usr/lib/php/extensions/no-debug-non-zts-20090626/ Pixel-Consulting:no-debug-non-zts-20090626 oscarpina$ ls


Could you try compiling phalcon with:

./install safe


I have compiled as you said but phalcon is not loaded in the web server : (


I think the problem is phalcon extension is in 64 bits:

sh-3.2# file Mach-O 64-bit bundle x86_64

And all php extensions are in 32 bits:

sh-3.2# file Mach-O bundle i386


I've tried to compile phalcon with:

./install 32bits

but the extension has 64 bits

sh-3.2# file Mach-O 64-bit bundle x86_64


Try the following:

cd cphalcon/build/32bits
export CFLAGS="-O2 -fno-delete-null-pointer-checks -finline-functions -fomit-frame-pointer -march=core2 -m32"
sudo make clean
sudo phpize --clean
./configure --enable-phalcon
make && sudo make install


This task is being very hard...

I've tried and zend server doesn't work : (

MAMP server works ok, but I don't have phalcon extension active.


I've built phalcon as 64 bits. I don't understand why phalcon extension is not in phpinfo in Configure command?

I hope win this war with my computer! : )

This is my phpinfo:

System Darwin Pixel-Consulting.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

Configure Command './configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php5.4.10' '--exec-prefix=/Applications/MAMP/bin/php/php5.4.10' '--sysconfdir=/Applications/MAMP/bin/php/php5.4.10/conf' '--with-config-file-path=/Applications/MAMP/bin/php/php5.4.10/conf' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl' '--enable-zip' '--with-iconv=/Applications/MAMP/Library

Loaded Configuration File /Applications/MAMP/bin/php/php5.4.10/conf/php.ini


I've more info:

[21-Apr-2013 20:39:41 Europe/Berlin] PHP Warning: PHP Startup: phalcon: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20100525 These options need to match in Unknown on line 0


This means the extension was compiled with the php 5.3 development environment (20090626) but PHP is running with php 5.4 (20100525)

Macports ( is usually an easy way to install php/apache/mysql packages without this complexity.


MAMP has a php version 5.2,5.3 and 5.4 and is very easy to install / uninstall php/apache/mysql. You can change of php version only with one click. The difficult for me is add this php extension.


MAMP does not provide the required libraries to compile a PHP extension, it just provide the binaries to run PHP, if you check Google there are full of articles making complex hacks to compile extensions for MAMP:

Also MAMP Server components and libraries don't provide the source code for PHP 5.4.x, making even more difficult get the necessary libraries to perform the compilation.

I compiled the extension for you, you can download it from: then copy the file to: /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/

and add to /Applications/MAMP/bin/php/php5.4.10/conf/php.ini


Thanks Phalcon! Unfortunately it has not worked : (


I've tested it using MAMP 2 loading/working without problem. Are you getting any messages in the logs?


Yes, the message is:

[22-Apr-2013 07:15:30 Europe/Berlin] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/' - dlopen(/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/, 9): no suitable image found. Did find: /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/ open() failed with errno=13 in Unknown on line 0


let me compile the extension just for 32bits, I think it's currently an Universal binary but your MAMP isn't able to load it


Ok. Thanks Phalcon for your help!


I have phalcon in my Mac! :)

I've done these steps :

1- I have deleted MAMP and MAMP PRO folders 2- I've installed MAMP 3- I've done the steps that @phalcon said me: copy the file to: /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/ and add to /Applications/MAMP/bin/php/php5.4.10/conf/php.ini 4- I've started MAMP server (not MAMP PRO).

Thanks a lot for all support!!



@phalcon: How did you compile it for MAMP? Even though I can compile commit 9911f5a2dea4536898e5804bdf50d01a78374929 on my debian server without any problems, on OSX it fails with

/Workspaces/Phalcon/cphalcon/build/64bits/phalcon.c:10556: error: too few arguments to function ‘phalcon_exp_is_callable_method_ex’
/Workspaces/Phalcon/cphalcon/build/64bits/phalcon.c: In function ‘phalcon_exp_call_user_method’:
/Workspaces/Phalcon/cphalcon/build/64bits/phalcon.c:11255: warning: passing argument 6 of ‘phalcon_exp_call_method’ makes integer from pointer without a cast
/Workspaces/Phalcon/cphalcon/build/64bits/phalcon.c:11255: error: too many arguments to function ‘phalcon_exp_call_method’
make: *** [phalcon.lo] Error 1


@Phalcon Can you compile the and (1.2.1) on M lion(10.8), Because i did not success to compile the Phalcon for 7 days, Thank you very much.


I upgrade to php 5.4 and phalcon v. 1.2.3 in MAMP via MacPorts:


sudo port selfupdate;sudo port -u upgrade outdated sudo port install php54-curl php54-ftp php54-iconv php54-mbstring php54-mcrypt php54-mysql php54-openssl php54-soap php54-sqlite php54-xsl php54-zip php54-xdebug php54-mongo sudo port select php php54 sudo port install automake autoconf libtool

and after install phalcon!

I have the same problem, so i found a great tutorial thats work to me:

edited Mar '14

Homebrew instruction:

# taps
$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap josegonzalez/homebrew-php
# php5*-phalcon
$ brew install php55-phalcon
$ brew --prefix php55-phalcon



2014-03-23 23 11 51



Raxan your link is just WORKFULL !!!! thx a lot i was desesperate with the install but you save my life xD.


@Ock glad that it help you