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);
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);
do this
echo ini_get("disable_functions");
to know if you are able to use one of the following:
system();
exec();
passthru();
shell_exec();
but if it's a shared hosting all the above are for sure blocked and you will have to find an alternative
.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:
system($shell_command, $response_var);
So in your case:
system("zcat $filename", $output);
In my case, disabled commands are
dl
sh2_exec
diskfreespace
disk_free_space
disk_total_space
escapeshellarg
escapeshellcmd
exec
highlight_file
link
lchgrp
lchown
passthru
pclose
popen
proc_close
proc_get_status
proc_nice
proc_open
proc_terminate
set_time_limit
shell_exec
show_source
symlink
system
mail
sendmail
So if one of those commands not blocked in your side, you may find a way to execute command.
© 2022 - 2024 — McMap. All rights reserved.
compress
format.Z
is not understood by zlib itself, so PHPsgzuncompress()
won't work. If you can't useexec
anymore, you'll have to adapt your file sources. Usegzip
from now on. – Mcclaryzcat
was a special version with .Z support; you might need to reinstall that or useuncompress -c $filename
rather. Also rememberescapeshellarg()
here. – Mcclary