10425 Views 4 Replies Latest reply: Oct 22, 2009 6:55 PM by Jason Smith7
Since 10.6 contains PHP 5.3, the PHP extensions directory has moved, and old extensions might not be compatible. But did you know that pecl and pear are now both available out of the box in 10.6? Assuming you have the developer tools, you can just install zip this way:
sudo pecl install zip
You'll notice that it places the zip.so extension in:
Then, to enable the extension, add the following line to /etc/php.ini:
Once you restart Web Service, the zip functions are available.
A nice idea, and would have made my day, unfortunately the result was:
Notice: Array to string conversion in PEAR/REST/10.php on line 85
Warning: Invalid argument supplied for foreach() in PEAR/REST/10.php on line 88
Warning: Invalid argument supplied for foreach() in /usr/lib/php/PEAR/REST/10.php on line 88
Fatal error: Cannot use string offset as an array in /usr/lib/php/PEAR/REST/10.php on line 256
Solved, thanks to elance.at
To install the zip extension, copy the missing pcre.h to /usr/include/php/ext/pcre/ and change the path
sudo cp cd ~/php-5.3.0/ext/pcre/pcrelib/pcre.h /usr/include/php/ext/pcre/
Then tell the compiler to build for 32 and 64 bits on a mac os x 10.6
CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
LDFLAGS="-arch i386 -arch x86_64 -bindatload"
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSXDEPLOYMENTTARGET
Now, the actual compilation:
sudo cp ~/php-5.3.0/ext/zip/.libs/zip.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
add the following to the /etc/php.ini
and finally restart the webserver
sudo apachectl restart