Page 1 of 1

zip_open() problem

PostPosted: 06. May 2005 09:22
by arcad
Hello!
3 days ago, I have installed XAMPP on Linux 2.6.10 (actually Mepis Linux). It works fine.
But yesterday, I wanted to do some zip reading....
Then

Code: Select all
Fatal error: Call ton undefined function zip_open() in /home/arcad/www/zipClass.php on LINE 8


So, it seems that the zip lib is not correctly installed?

phpinfo() shows something like
Code: Select all
  - - with zip=/opt/lampp

In the directory /opt/lampp , there is no zip binary .... the zip lib are elsewhere (I guess somewhere under /opt/lampp/bin ... I'm not at home, so, I cannot tell you exactly. And Those where simbolic links...)

Please, is this a known problem?
If yes, is there any fix?

Thanks for for nice work!

Arcad.

PostPosted: 07. May 2005 14:50
by Oswald
Dear Arcad!

As far as I remember PHP5 doesn't support ZIP by default any more. Please switch to PHP4. Simply call:

/opt/lampp/lampp php4

Best greetings
Oswald

PostPosted: 09. May 2005 09:23
by arcad
Kai 'Oswald' Seidler wrote:Dear Arcad!

As far as I remember PHP5 doesn't support ZIP by default any more. Please switch to PHP4. Simply call:

/opt/lampp/lampp php4

Oswald


Thanks Oswald for the answer.

Unfortunately, my code is written for PHP5 (pure OOP), so I'm somehow stuch with PHP5 :-(

PostPosted: 17. May 2005 17:39
by Oswald
Dear Arcad!

In the next XAMPP for Linux release I will include the PECL ZIP module. So also PHP5 will "talk" ZIP.

Maybe that's a little help for your work.

Greetings
Oswald

PostPosted: 18. May 2005 09:30
by arcad
Kai 'Oswald' Seidler wrote:Dear Arcad!

In the next XAMPP for Linux release I will include the PECL ZIP module. So also PHP5 will "talk" ZIP.

Maybe that's a little help for your work.

Greetings
Oswald


That would be really GREAT!

I have downloaded the XAMPP dev package and also the PECL zip module.

But unfortunately, I was not able to compile it.
Later, I've heard that I have to download the whole source or all (PHP, apache, MySQl, etc, etc). So, I gave up.

What I need is just the PHP module, so, noneed to compile MySQL etc.

Is there any doc about how to compile/add a PHP module myself?

When will be the next release? :-)

Thanks.

PostPosted: 18. May 2005 09:51
by Oswald
Dear Arcad!

Please try this:

1. Download http://www.apachefriends.org/files/linux/1.4.13/zip.so
2. Put it into /opt/lampp/lib/php/extensions/no-debug-non-zts-20041030
3. Edit /opt/lampp/etc/php.ini and add the following line somewhere next to all the other ";extension=" lines:

extension="zip.so"

4. Restart XAMPP.

PHP5 should now have the ZIP extension. PHP4 may not work with this line. So if you want to use PHP4 you may need to remove this line before.

Good luck
Oswald

PostPosted: 18. May 2005 10:13
by arcad
Kai 'Oswald' Seidler wrote:Dear Arcad!

Please try this:

1. Download http://www.apachefriends.org/files/linux/1.4.13/zip.so
2. Put it into /opt/lampp/lib/php/extensions/no-debug-non-zts-20041030
3. Edit /opt/lampp/etc/php.ini and add the following line somewhere next to all the other ";extension=" lines:

extension="zip.so"

4. Restart XAMPP.

PHP5 should now have the ZIP extension. PHP4 may not work with this line. So if you want to use PHP4 you may need to remove this line before.

Good luck
Oswald


I've downloaded the .so file

I'll try it at home and let you know tomorrow.

No, I do not need PHP4.

BTW, is there any doc explaining how to compile the stuff myself? (That way, more people could get involved which may help you)

Thanks

PostPosted: 18. May 2005 10:28
by Oswald
arcad wrote:I'll try it at home and let you know tomorrow.


That would be great. Thanks!

arcad wrote:BTW, is there any doc explaining how to compile the stuff myself? (That way, more people could get involved which may help you)


That's very difficult because it depends on so many factors. A general documentation on installing PECL can found here: http://www.php.net/manual/en/install.pecl.php (but in case of XAMPP and ZIP only the phpize installation way will work)

Your question is in some way like: How do I replace the back light in my car? There are so many different cars and so there it's hard to write a single documentation.

But anyway we're trying to make such a documentation: At the moment Kay and I are writing a book about XAMPP and there is also a chapter about expanding XAMPP with "own" PECL modules. But that book will be published not until the end of this year and it will be in German. So it's no help for you.

Best regards
Oswald

PostPosted: 18. May 2005 11:05
by arcad
Kai 'Oswald' Seidler wrote:
arcad wrote:I'll try it at home and let you know tomorrow.


That would be great. Thanks!

arcad wrote:BTW, is there any doc explaining how to compile the stuff myself? (That way, more people could get involved which may help you)


That's very difficult because it depends on so many factors. A general documentation on installing PECL can found here: http://www.php.net/manual/en/install.pecl.php (but in case of XAMPP and ZIP only the phpize installation way will work)

Your question is in some way like: How do I replace the back light in my car? There are so many different cars and so there it's hard to write a single documentation.

But anyway we're trying to make such a documentation: At the moment Kay and I are writing a book about XAMPP and there is also a chapter about expanding XAMPP with "own" PECL modules. But that book will be published not until the end of this year and it will be in German. So it's no help for you.

Best regards
Oswald


OK.

Thanks.

It works!

PostPosted: 19. May 2005 09:14
by arcad
Hello Oswald!

I have dones the changes on my Linux at home.

Now, my PHP5 code can read/extract zip files!

So, MANY thanks for the great work!

Arcad.