archivemode works for tar, not for zip

Having problems installing or using kPlaylist.

archivemode works for tar, not for zip

Postby Gaucho » Sat Mar 14, 2009 7:30 pm

Hello,
This is concerning archivemode, so I’m almost afraid to ask.
I want to enable multiple downloads in kplaylist 1.8.502.
Running my own server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.5 MySQL 5.0.51a
Can’t get it to work with zip as preferred archiver.
I searched the forum and tried every suggestion that seemed relevant but nothing solved my problem.

In the script I did:
$cfg['archivemode'] = true;

The archivers are:
$archivers = array();

$archivers[] = array(1, 'zip', '/usr/bin/zip -j -0 %D "%F"', 'application/zip', 'zip');
$archivers[] = array(1, 'tar','/bin/tar cf %D --files-from "%LIST"', 'application/x-tar', 'tar');

When I select tar as Preferred archiver in kplaylist – Options, everything works smoothly.
So it looks like my tmp-directory setting’s OK and the directory is writable.
($cfg['archivetemp'] = '/tmp/';)

When I select zip or zip inbuilt something goes wrong:

When I use the Download/Album or the Download/Selected button, a small window opens with the name of one albumtrack and the message:
Could not create archive! and nothing else happens.

Then I did: $cfg['archivemodedebug'] = true;
This time, when I use the Download/Album or the Download/Selected button, the small window opens with the name of one albumtrack but nothing else.
No message, no commands. No clues.

/usr/bin/zip is there and executable for “Others”
Even did a chmod 777 on it to make sure. Didn’t help either.

What could be wrong?
Any help is greatly appreciated.

Grtz
Gaucho
Gaucho
 
Posts: 21
Joined: Mon Nov 14, 2005 10:13 pm
Location: Netherlands

Re: archivemode works for tar, not for zip

Postby maever » Sun Mar 15, 2009 2:16 pm

Hello Gaucho,

I have explained similar issues.
The error can actually be caused by either not having the "zip" package installed on your linux or security measures such as having "exec" disabled.

To get to the bottom of the error, first you would need to turn on error reporting.
(since this is turned off by default).

open your main kplaylist file (index.php in my case).
Scroll a little but down and look for the line: @ini_set('display_errors', 'Off');
Now either comment out this line or turn it to "On".

Code: Select all
@ini_set('display_errors', 'On');


Now save the file and try using the archiver again.

I hope this helps.
maever
 
Posts: 7
Joined: Mon Feb 04, 2008 11:38 pm
Location: Netherlands

Re: archivemode works for tar, not for zip

Postby Gaucho » Sun Mar 15, 2009 2:57 pm

Hello Maever,

Thanks a lot for your reply.
But what can I say? I checked the settings you suggest:

"zip" package is installed (/usr/bin/zip)
In my script it already says: @ini_set('display_errors', 'On');

With this setting the problem occurs.
Any more ideas?
Hope you've got the time to help me sort this out.

Grtz.

Gaucho
Gaucho
 
Posts: 21
Joined: Mon Nov 14, 2005 10:13 pm
Location: Netherlands

Re: archivemode works for tar, not for zip

Postby maever » Mon Mar 16, 2009 1:39 pm

The idea wasn't that it fixed your problem.

With error reporting on you should get an extra error message when you try to download an archive.
An error I recently encountered was "Function exec() is on the disabled list"
This is due to my PHP security where I chose to disable functions such as these.

if you do not see any extra output information, you could try to just comment out the line instead and try again.

tell me what output info you get when attempting to download an archive.
maever
 
Posts: 7
Joined: Mon Feb 04, 2008 11:38 pm
Location: Netherlands

Re: archivemode works for tar, not for zip

Postby Gaucho » Mon Mar 16, 2009 4:43 pm

Ok.
I played around with those settings in the script.
Then I tried to download an album containing 12 mp3-songs.

@ini_set('display_errors', 'On');
$cfg['archivemode'] = true;
$cfg['archivemodedebug'] = true;
With those settings the "Archive creator window" gives:
100% .. 12 - Hometown Glory.mp3

// @ini_set('display_errors', 'On');
$cfg['archivemode'] = true;
$cfg['archivemodedebug'] = true;
With those settings the "Archive creator window" gives:
100% .. 12 - Hometown Glory.mp3

@ini_set('display_errors', 'Off');
$cfg['archivemode'] = true;
$cfg['archivemodedebug'] = true;
With those settings the "Archive creator window" gives:
100% .. 12 - Hometown Glory.mp3

@ini_set('display_errors', 'Off');
$cfg['archivemode'] = true;
$cfg['archivemodedebug'] = false;
With those settings the "Archive creator window" gives:
100% .. 12 - Hometown Glory.mp3
Could not create archive!


That's all the output-info I can get.
So the only setting changing anything is: $cfg['archivemodedebug']
Nothing as to why the archive can't be created.
Note that archiving with tar as an archiver works fine!
tmp-folder settings and allowing executionals should be OK. Or am I wrong?

I presume the error-reporting should show in the "Archive creator window"?
Or is kplaylist logging errors elsewhere?

Gaucho :?:
Gaucho
 
Posts: 21
Joined: Mon Nov 14, 2005 10:13 pm
Location: Netherlands

Re: archivemode works for tar, not for zip

Postby Gaucho » Mon Mar 16, 2009 9:28 pm

additional info:
I found that, using zip as archiver, a file is written to the tmp-directory by the webserver.
The filename starts with: kppack and has 6 more numbers/letters.
But the file is of an unknown filetype and is 0 bytes.
Looks like zip itself is not working properly. Reinstalled it, but the problem persists.
Still puzzled.

Gaucho :evil:
Gaucho
 
Posts: 21
Joined: Mon Nov 14, 2005 10:13 pm
Location: Netherlands

Re: archivemode works for tar, not for zip

Postby Gaucho » Tue Mar 17, 2009 10:05 pm

Solved and to dumb to be true:

Still don't know why there is no output in debugmode though.
But who cares, got zip to work!
Found it in the forum searching for "zip error"
Turned out that kplaylist gave a zip-output where every / was converted to \
This way the files to be archived couldn't be found by the archiver on my Linux-server.

In Settings - General in kPlaylist "A Windows system" was set. :oops: (First Windows Ubuntu system around)

Sorry for taking up your time and boardspace.
Maever, thanks for looking into this.
kplaylist rocks!
This board rocks! (except for my latest contribution)

grtz. Gaucho
Gaucho
 
Posts: 21
Joined: Mon Nov 14, 2005 10:13 pm
Location: Netherlands


Return to Community support



cron