php exec、passthru 函数在主机上禁用时可以解决
我的网站是基于 php 的,主机禁用了 exec()、passthru() 和 system()。我有一个需要这些功能的脚本。有什么解决方法吗?
我的脚本运行的命令很简单 mysqldump 来备份我的数据库。如果没有解决方法来使用这些功能。有没有其他方法可以在不需要使用它们的情况下进行备份?
My site is php based and the host disabled exec() and passthru() and system(). I have a script that needs these functions. Is there any work arounds?
The commands my script to run is simple mysqldump to backup my database. If there's no work arounds to use those functions. Is there another way to do the backup without the need to use them ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你的主机不会无缘无故地禁用 exec() 。如果你找到办法做到这一点,
他们可能会尽力关闭它,和/或关闭您的帐户。
I think your host does not disabled exec() without a reason. If you find a way to do it,
they'll likely do their best to close it, and/or close your account.
不,它们被禁用是为了防止安全漏洞。能够规避这些破坏了禁用它们的全部目的
No, they were made disableable to prevent security leaks. Being able to circumvent these undermines the whole purpous of disabling them
备份 MySQL 数据库的一个简单的解决方案是使用 SELECT ... INTO OUTFILE 和 LOAD DATA INFILE ... 。它们不会解决您的所有问题,但当您无法运行 shell 命令时,它是一个快捷方式。
A naive solution for backing up MySQL DBs is to use
SELECT ... INTO OUTFILE
andLOAD DATA INFILE ...
. They won't solve all your problems, but it's a shortcut when you can't run shell commands.