php (rar) 我想通过 php (在 dedi 服务器上) noob 在 Ubuntu (linux) 上使用 rar 来 rar 一个文件夹

发布于 2024-08-30 06:52:32 字数 1480 浏览 5 评论 0原文

嘿家伙,我想要使用 php

RAR

在我的服务器上 rar(而不是 tar)我的文件夹

RAR 3.93 版权所有 (c) 1993-2010 亚历山大·罗沙尔 2010 年 3 月 15 日 以我的真实姓名注册

操作系统

Ubuntu 版本 (Karmic) 内核 Linux 2.6.32.2-xxxx-grs-ipv4-32 侏儒 2.28.1

最新的 php 和 lighthttpd

我已经尝试过这些东西

http://php.net/manual/en/function.escapeshellarg.php   // may be wrong code 
http://php.net/manual/en/function.exec.php
http://php.net/manual/en/function.shell-exec.php

我的命令(在 ssh 和 nautilus 脚本中工作)

rar a -m0 /where/file/will/saved/file_name.rar /location/ti/data/dir/datafolder

php 代码

$log=Shell_exec("rar a -m0 /where/file/will/saved/file_name.rar /location/ti/data/dir/datafolder");
echo $log;

留下了一种方法,我不知道如何使用和它在通过 somefile_to_execute_command.sh 的服务器上工作,我必须从 php 执行 .sh 文件,需要发送一些变量(命令),

我尝试了此方法可以使用名为 RapidLeech 的脚本生成 rar 文件,但它的 rar 仅来自其自己的文件目录:( 但我想在不同的目录中执行操作。Rapid

Leech rar 类

http://paste2.org/p/791668

我可以使用 php 运行 shell 命令(cp(复制),mv(移动),ls(目录列表),rm(删除又名删除))但失败运行rar我没有给出任何输出我也尝试给定路径rar并且我使用了很多带有php Shell_exec函数的命令并且像它们与ssh一起工作一样工作并且我已经尝试了网上给出的几乎80%的方法并且从过去3天开始失败了我现在请帮助我需要 php 脚本文件工作,请回复,如果你有关于 rar 和这种的任何信息、代码和经验:( 问题

我 99% 菜鸟只是使用代码意味着搜索 Google 收集脚本制作我自己的工作内容(仅供个人使用)n现在我无法打开rar文件夹和文件:((

现在请给我提供代码,请不要用技术语言说话,因为我只是在读我的第一本php书(对于傻瓜来说:D)意味着菜鸟和0.1

请尽可能帮助我

谢谢

hey guyz i want rar (not tar) my folder on my server by using php

RAR

RAR 3.93 Copyright (c) 1993-2010
Alexander Roshal 15 Mar 2010
Registered to my real name

OS

Ubuntu Release (Karmic) kernel linux
2.6.32.2-xxxx-grs-ipv4-32 Gnome 2.28.1

latest php an lighthttpd

i have tried these things

http://php.net/manual/en/function.escapeshellarg.php   // may be wrong code 
http://php.net/manual/en/function.exec.php
http://php.net/manual/en/function.shell-exec.php

my command (working in ssh and nautilus script)

rar a -m0 /where/file/will/saved/file_name.rar /location/ti/data/dir/datafolder

php code

$log=Shell_exec("rar a -m0 /where/file/will/saved/file_name.rar /location/ti/data/dir/datafolder");
echo $log;

one method is left which i don't know how to use and its working on server that is by somefile_to_execute_command.sh i have to execute .sh file from php need to send some variables (command) and

i tried this method can rar file with a script named RapidLeech but its rar from only its own files dir only :( but i want to do in different directories.

Rapid Leech rar class

http://paste2.org/p/791668

i m able run shell command with php (cp(copy),mv(move),ls(directory list),rm(remove aka delete)) but got failed to run rar i gives no output i also tried to given path rar and i used alot commands with php Shell_exec function and working like they work with ssh and i have tried almost 80 % method given on net and failed from last 3days i m over now plz help me i need php script file working plz reply if u have any info n code and experience about rar and this kinda :( problem

i m 99% noob just used code mean search Google collect script make my own working thing (for personal use only) n now i m failed to rar folder and file :((

now plz provide me code plz don't talk in technical language because i m just reading my first php book (for dummies :D) mean noob and 0.1

plz help me as much as u can

thankx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苏大泽ㄣ 2024-09-06 06:52:32

可以使用ubuntu自带的rar包。只需参阅 rar --help 即可获取 rar 包帮助。
然后,只需使用 系统函数 或 shell_exec 在 php 内部调用它。

You can use the rar package which comes with ubuntu. Just see rar --help for rar package help.
Then, just call it inside the php itself using the system function or the shell_exec.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文