Hi there,

I was wondering whether anyone would be able to assist me.

I am trying to use the zip class that is a PECL package. I believe that I have followed the instructions to the T and have spent hours trying to figure out why it wont work.

Here is what I have done:

downloaded the zip package to my desktop

Opened up terminal and written the following:

  • cd ~/Desktop/zip/
  • phpize
  • /configure
  • make
  • sudo make install
  • Updated the PHP ini with extension=zip.so
  • updated my PHP ini file with the extension_dir of /usr/lib/php/extensions/no-debug-non-zts-20060613/
  • restarted apache

The when I try to access the ZipArchive class within my localhost I get the following error:
Fatal error: Class 'ZipArchive' not found in /Users/myname/Sites/zip_test/index.php on line 14

I simply cant find a solution to this and would really appreciate it if anyone could provide any assistance on this issue.

Cheers

Jon

    Any errors along the make/configure process?

    Can you switch to the extensions directory and verify that 'zip.so' is there (and has a non-zero length)?

    If you do a phpinfo(), what value does it show for the extension directory? Do you see a "zip" table?

    Can you make other changes to your php.ini (e.g. switch display_errors to On or Off), restart Apache, and verify that a phpinfo() reflects your changes?

      Hi there,

      Thanks for the reply . . .

      I checked the phpinfo and the extension path was correct, additionally, I navigated to the extension diretory and saw that the zip.so file was present.

      I carried on googling and eventually decided stumbled acorss the following post which seamed to solve the issue

      http://blog.scrumpy-jack.com/2009/01/enabling-php-extensions-on-mac.html

      Note point 4 with the extra configuration options . . . I ran the ./configure with the following additional commands and it all fell into place.

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

      Hopefully this answer will help someone else if they come across the same issue.

      Many thanks for your help.

      Jon

        Write a Reply...