Alternative PHP function exec ()

I am currently using:

exec("zcat $filename", $output) 

To unzip a file of type .Z , but, unfortunately, my hosting company has now disabled this feature.

Is there any workaround?

 $pathtofile = "filename.lis.Z"; exec("zcat $pathtofile", $output); 
+7
source share
3 answers

do it

 echo ini_get("disable_functions"); 

to find out if you can use one of the following values:

system(); exec(); passthru(); shell_exec();

but if it’s shared hosting, all of the above are probably blocked, and you will have to find an alternative

+6
source
 system($shell_command, $response_var); 

So in your case:

 system("zcat $filename", $output); 
+2
source

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

+2
source

All Articles