Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternate to PHP exec() function

Tags:

php

exec

zcat

Currently I am using:

exec("zcat $filename", $output)

To uncompress a .Z type file but unfortunately my hosting company has now disabled this function.

Is there a workaround?

$pathtofile = "filename.lis.Z";
exec("zcat $pathtofile", $output);
like image 376
Saad Bashir Avatar asked Sep 27 '11 06:09

Saad Bashir


1 Answers

.Z files are LZW compression. If you can't run shell commands on your host, you can use an LZW PHP library. Here are two:

  • web wonders
  • php-lzw
like image 59
six8 Avatar answered Sep 20 '22 17:09

six8