Re: [PHP-INSTALL] Mac OS X + Apache2 + Dynamic Libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As you have now found out, doing the auto-build from PECL doesn't work.

Start by building the dependancies (libraries that are linked in the build) then the modules.

(you can copy the next 7 following lines verbatim since this works for most source packages, the 8th line is what you need to add per package so do not copy this line, it is a placeholder)
CFLAGS=" -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" \
CXXFLAGS=" -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" \
LDFLAGS=" -arch i386 -arch x86_64 -force-flat-namespace" \
./configure \
- --disable-dependancy-tracking \
- --disable-shared \
- --enable-static \
<REST OF CONFIGURE FLAGS>

If you build it properly and you build for all Mac supported architectures your module will work on any Mac running any 10.5.x

Here's the memcache build using this principal.
http://daleenterprise.com/download/memcache.so (not for general consumption)

- -- BuildSmart

On Mar 30, 2009, at 14:27 PM, Stutter Stutters wrote:

I used Pecl to install memcache and imagick, I ran the command you
mentioned and this was the output:

$ file /usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so
/usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so: Mach-O
bundle i386


I don't see anything regarding x86_64, so I assume it's not built with
64 bit support.  Sounds like an awesome time to fix.  Especially,
since I don't know where to begin :(

Any pointers?

-Stutter

On Mon, Mar 30, 2009 at 1:05 PM, BuildSmart
<buildsmart@xxxxxxxxxxxxxxxxxx> wrote:
On Mar 30, 2009, at 09:22 AM, Stutter Stutters wrote:

I've been wrestling with mac os x + php 5.2.6 off and on for a few months to get it to load the memcache.so and imagick.so extensions. When I executed php on the command line `php -i | grep imagick` or `php -i | grep memcache`
the output shows that imagick and memcache are both being loaded
successfully, and I can successfully use both libraries..from the command
line.

However, when I restart apache, the logs show that both extensions can not
be loaded:

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

Let me take a wild guess, you built the modules and they don't include the
x86_64 architecture?
The following command will show the available architectures:
file /usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so
The good news is you can rebuild all of your dependent libraries for multi architecture and rebuild all of your modules to be multi architecture and
you will have solved your problem.

Both files are obviously there (as they are being loaded via the CLI
execution of php). I've checked, both apache and php-cli are using the same php.ini configuration. I've thought it was some kind of permission or environment issue for the _www user, but i've managed to change my env information to the same as the _www user's (or, at least, as well as I know how) and I am still able to execute php from the CLI and have successfully
loaded imagick and memcache.

Again, I'm using OS X Leopard, and PHP 5.2.6, and Apache 2.2.9

Any help would be much appreciated.

Thanks!

stutter.

-- BuildSmart






-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)

iD8DBQFJ0ffe0hzWbkf0eKgRAv2AAJ45Zx/I0UdzC/OonJJ1ueyp7Uu5dQCfUGZT
NXRKTc7iXxuZHdHBRRcKP9s=
=maLI
-----END PGP SIGNATURE-----

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux