我正在使用的当前服务器禁用了exec函数。是否可以使用php脚本提取tar并保留权限?
您可以使用PharData
类:
示例:Create a tar
$phar = new PharData('test.tar');
// add all files in the project
$phar->buildFromDirectory('/path/to/files');
示例:Unpack a tar
$phar = new PharData('test.tar');
// add all files in the project
$phar->extractTo('/path/to/files');