Entropy.ch Discussion Forums Forum Index Entropy.ch Discussion Forums
Discussion forums about Mac OS X software development.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling Modules in Leopard

 
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> PHP on Mac OS X
View previous topic :: View next topic  
Author Message
solsys



Joined: 20 Jan 2006
Posts: 4

PostPosted: Mon Nov 05, 2007 3:38    Post subject: Compiling Modules in Leopard Reply with quote

Installed Release 5 from the other thread on my gimpy little G4 Mini, and it works great. Now I want to install XDebug & PHPUnit...

How do I convince pecl to compile modules against this version of PHP? Using /usr/local/php5/bin/pecl still compiles against the the built-in version of php...

Compiling against the built-in version results in modules that compile, but don't work (they die with a seg fault, Wez said that this has something to do with exports being stripped from the built-in version...)

Thanks!
Back to top
View user's profile Send private message
Taracque



Joined: 23 Aug 2006
Posts: 6

PostPosted: Tue Nov 06, 2007 19:40    Post subject: Make pecl work, quick and DIRTY Reply with quote

What i have did, is the following:
removing php,phpize,php-config,pecl,pear,peardev from /usr/bin/
make symlinks to /usr/local/php5/bin like this
Code:
cd /usr/bin
sudo ln -s /usr/local/php5/bin/php .
sudo ln -s /usr/local/php5/bin/phpize .
sudo ln -s /usr/local/php5/bin/php-config .
sudo ln -s /usr/local/php5/bin/pear .
sudo ln -s /usr/local/php5/bin/peardev .
sudo ln -s /usr/local/php5/bin/pecl .

i have removed /usr/share/pear directory, and make a symlink too:

Code:
cd /usr/share
sudo ln -s /usr/local/php5/lib/php pear


Taracque
Back to top
View user's profile Send private message
solsys



Joined: 20 Jan 2006
Posts: 4

PostPosted: Fri Nov 09, 2007 20:29    Post subject: Reply with quote

Doh!, forgot about phpize & php-config, I aliased everything else but those would cause a problem...

Other than an annoying crashing bug in XDebug itself(don't try to include a file that doesn't exist when using XDebug 2.0.1), it works fine now.

Thanks!
Back to top
View user's profile Send private message
kashbridge



Joined: 27 Jan 2006
Posts: 2

PostPosted: Sat Nov 10, 2007 12:31    Post subject: XDebug not working Reply with quote

Hi,

I can't get debug working with PHP5 under Leopard on a Mac Pro (64 bit). I have installed the latest binary from entropy.ch, and that is working. XDebug.so, however, crashes with a segmentation fault. If I force PHP to run as a 32-bit using "arch -i386 /usr/local/php5/bin/php -v", XDebug will now show up in the phpinfo() listing, but it still doesn't work. I've even tried recompiling XDebug 2.0.1 on my own system, but same problem. Any ideas?

Would any of those people who keep saying "Works for me", please let us know if you're using a 32-bit system? I think the 64-bit Mac may be the stumbling block.

Many thanks,
Kevin.
Back to top
View user's profile Send private message
solsys



Joined: 20 Jan 2006
Posts: 4

PostPosted: Sun Nov 11, 2007 8:26    Post subject: Reply with quote

My Mini is a 32bit PowerPC. Going to try compiling it on my MacBook Pro (32bit Core Duo) some time this week. I'll let you know if it works.
Back to top
View user's profile Send private message
znarf



Joined: 11 Nov 2007
Posts: 1

PostPosted: Tue Nov 13, 2007 1:39    Post subject: Reply with quote

I tried compiling extensions like apc or memcache :

Code:
sudo pecl install apc
sudo pecl install memcache


Compilation works fine but extensions are not loading :

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/apc.so' - (null) in Unknown on line 0

I tried to symlink like mentioned above (before compiling), but that was not better.
Back to top
View user's profile Send private message
mstearne



Joined: 11 Dec 2007
Posts: 3

PostPosted: Tue Dec 11, 2007 19:09    Post subject: Reply with quote

znarf wrote:
I tried compiling extensions like apc or memcache :
...
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/apc.so' - (null) in Unknown on line 0

I tried to symlink like mentioned above (before compiling), but that was not better.


I am getting the same error. Has anyone compiled and gotten this to work correctly?

Thanks!
Back to top
View user's profile Send private message
CMKoehler



Joined: 04 Dec 2007
Posts: 4

PostPosted: Tue Dec 11, 2007 20:45    Post subject: Reply with quote

Getting the same thing with xdebug, no matter how I compile it. pecl and pear doesn't work, compiling it myself with phpize leads to the same result.
"which phpize" points to the right one in /usr/local/php5/

When compiling it myself and running "make test" as it says, I get this:

Code:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so' - (null) in Unknown on line 0
/bin/sh: line 1: 47295 Segmentation fault      TEST_PHP_EXECUTABLE=/usr/local/php5/bin/php TEST_PHP_SRCDIR=/tmp/xdebug-2.0.2 CC="gcc" /usr/local/php5/bin/php -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' /tmp/xdebug-2.0.2/run-tests.php -U -d extension_dir=modules/ ` if test "x/tmp/xdebug-2.0.2/modules/xdebug.la" != "x"; then for i in /tmp/xdebug-2.0.2/modules/xdebug.la""; do . $i; /tmp/xdebug-2.0.2/build/shtool echo -n -- " -d extension=$dlname"; done; fi` tests/
make: [test] Error 139 (ignored)
Back to top
View user's profile Send private message
mstearne



Joined: 11 Dec 2007
Posts: 3

PostPosted: Fri Dec 14, 2007 10:20    Post subject: Reply with quote

CMKoehler wrote:
Getting the same thing with xdebug, no matter how I compile it. pecl and pear doesn't work, compiling it myself with phpize leads to the same result.
"which phpize" points to the right one in /usr/local/php5/


phpize is probably not the issue. It would be great if anyone could make a suggestion. Does it matter that the configure is different in Leopard than it was for Tiger?

10.4:
'./configure' '--prefix=/usr/local/php5' '--with-apxs' .......
'--with-fbsql=shared,/Users/liyanage/svn/entropy/universalbuild/src/FBDeveloperLibraries/Library/FrontBase' '--with-json=shared' '--enable-memcache' '--enable-openbase_module'

10.5:
'./configure' '--disable-dependency-tracking' '--prefix=/usr/local/php5' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-openssl=/usr'
.....'--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/local/php5'

In the 10.5 configure there is no --enable-memcache.
Back to top
View user's profile Send private message
Jaza



Joined: 28 May 2009
Posts: 1

PostPosted: Thu May 28, 2009 9:09    Post subject: Worked out Reply with quote

I've worked it out! The issue is that when you compile on Leopard, the built-in Xcode C compiler builds it for a 32-bit architecture by default, even though all Leopard installs are on 64-bit hardware.

To compile for 64-bit hardware, you need to do the 'configure' step like this:

Code:
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure


See this blog post I just wrote, about compiling the uploadprogress extension.
Back to top
View user's profile Send private message Visit poster's website
bunam



Joined: 22 Jul 2004
Posts: 4

PostPosted: Sat May 30, 2009 21:47    Post subject: Reply with quote

i have done by using this "simple command" :

Code:
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load"  pecl install apc



so i have
Code:
apc

APC Support   enabled
Version   3.0.19
MMAP Support   Enabled
MMAP File Mask   no value
Locking type   File Locks
Revision   $Revision: 3.154.2.5 $
Build Date   May 30 2009 22:44:18
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> PHP on Mac OS X All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group