CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • zip_read and zip_close warning
Pages: [1]

Author Topic: zip_read and zip_close warning  (Read 6289 times)

geraldr_sc

  • Guest
zip_read and zip_close warning
February 09, 2009, 09:45:43 am
I am upgrading on joomla 1.5.8 followed the instructions on http://wiki.civicrm.org/confluence/display/CRMUPCOMING/Upgrade+Joomla+Sites+to+2.2

I ran the install following step 3 on the wiki page and got this error:
JFile::read: Unable to open file: 'JOOMLA-ROOT/administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.tpl

I also got these warnings:
Warning: zip_read() expects parameter 1 to be resource, integer given in JOOMLA-ROOT/libraries/joomla/filesystem/archive/zip.php on line 234

Warning: zip_close() expects parameter 1 to be resource, integer given in JOOMLA-ROOT/libraries/joomla/filesystem/archive/zip.php on line 250

Warning: fopen(JOOMLA-ROOT/administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.tpl) [function.fopen]: failed to open stream: No such file or directory in JOOMLA-ROOT/libraries/joomla/filesystem/file.php on line 239

Warning: fopen(JOOMLA-ROOT/administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.tpl) [function.fopen]: failed to open stream: No such file or directory in JOOMLA-ROOT/libraries/joomla/filesystem/file.php on line 239


I then copied administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.sample.tpl to civicrm.settings.php.tpl and then got these warnings:

Warning: zip_read() expects parameter 1 to be resource, integer given in JOOMLA-ROOT/libraries/joomla/filesystem/archive/zip.php on line 234

Warning: zip_close() expects parameter 1 to be resource, integer given in JOOMLA-ROOT/libraries/joomla/filesystem/archive/zip.php on line 250
Files uploaded succesfully


It also gave Install Component Success

Should I proceed with step 4 or is the install broken?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: zip_read and zip_close warning
February 09, 2009, 09:59:20 am

1. most likely your install is broken

2. you will need to research and figure out why joomla / zip functions is giving that error. Please update this topic once you figure it out. We do not get that error on our local installs

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: zip_read and zip_close warning
February 09, 2009, 05:09:52 pm
I get this one on my laptop.

I've traced it to a problem with zip_open which is called from the Joomla! JArchive class. The problem is that zip_open returns an error code (ZIPARCHIVE::ER_READ) rather than a resource, which the Joomla! code doesn't pick up. This leads to zip_read and zip_close failing.

When I instrument the code, this is what I see ...

echo zip_open($archivename);                => 5
echo constant('ZIPARCHIVE::ER_READ');   => 5

The bug reported at http://bugs.php.net/bug.php?id=44974&edit=1 seems to be a possible candidate. Though the bug description refers to ZipArchive, note that the patch is made to zip_open.c. The indicators for this bug match my environment: PHP 5.2.6; 64-bit Linux; and a zip file with more than 1300 elements. I see from geraldr_sc's profile that he is also using PHP 5.2.6 - perhaps he could reply to give more details about his environment to show if the problem affects other platforms.

I can workaround this problem by running the install, getting the error, then unzipping the zip file manually (unzip civicrm.zip from the ...administrator/components/com_civicrm directory), and then running the install a second time. Though the second install gets zip errors, these have no impact on the success of the install as the unzipped contents are in place.

From my investigations ...
  • This is a PHP issue, not a Joomla! issue (though Joomla! could do better error detection). The problem could be faced by Drupal users, unless they use different libraries
  • It's probably limited to particular environments, though how widespread is hard to say
  • There is an (ugly) workaround

Could we avoid the use of a zip file? The contents could be copied as directory tree.
« Last Edit: February 09, 2009, 05:14:00 pm by ken »

geraldr_sc

  • Guest
Re: zip_read and zip_close warning
February 09, 2009, 06:19:46 pm
Thanks for your help. It gives me something to work with.

The Linux version is  2.6.9-67.0.15.ELsmp (mockbuild@builder10.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 SMP Thu May 8 10:50:20 EDT 2008 on a shared host.

The zip output from phpinfo() is
  Zip enabled
  Extension Version $Id: php_zip.c,v 1.1.2.43 2008/01/18 00:51:38 pajoye Exp $
  Zip version 1.8.11
  Libzip version 0.8.0-compatible

What other information from the environment would be useful?

Gerald
« Last Edit: February 09, 2009, 06:25:33 pm by geraldr_sc »

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: zip_read and zip_close warning
February 09, 2009, 11:52:34 pm
This is my zip configuration when I print php_info ...
Zipenabled
Extension Version$Id: php_zip.c, v 1.1.2.43 2008/01/18 00:51:38 pajoye Exp $
Zip version1.8.11
Libzip version0.8.0-compatible

... so we have a match, bro. It would be interesting to know what is the environment that the CiviDudes are using.

BTW, is your host a 64-bit machine?

As far as "what next" goes, I'm like the cartoon dog chasing the rooster: I've just reached the end of my leash (twang!).

Ken

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: zip_read and zip_close warning
February 09, 2009, 11:59:32 pm
BTW I just found this suggestion from Lobo on another thread

Quote from: Donald Lobo on February 08, 2009, 06:14:08 pm

if you are php/shell savvy, you can do the following:

1. unzip the civicrm distribution to a directory

2. unzip the civicrm.zip file from the above directory

3. modify the civicrm.xml file to reference the civicrm folder (<folder>civicrm</folder>) and remove the reference to the zip file

4. modify configure.php and comment out the part which unzips the zip file

lobo


geraldr_sc

  • Guest
Re: zip_read and zip_close warning
February 10, 2009, 08:56:30 pm
It is a shared host, but it is a 64 bit machine.

The quote from Lobo is helpful.

Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • zip_read and zip_close warning

This forum was archived on 2017-11-26.