【发布时间】:2023-03-30 04:57:01
【问题描述】:
我在 php 文件中使用了 bash 文件。 (需要/包含)之后,当我想运行 bash 文件,但不想要的代码将被返回。结果终于来了。但是不必要的代码来了。
<?php
require_once("shapemorph");
ob_start();
$imageFile2 = 'one-car.jpg';
$imageFile1 = 'two-car.jpg';
shell_exec('./shapemorph -d 10 -p 100 -r "73,56 57,68" '.$imageFile2.' '.$imageFile2.' testfy.gif');
ob_end_flush();
exit;
?>
我也为此使用了 ob_start()。但是代码还是来了。
我不希望代码被退回。
【问题讨论】:
-
如果你将它直接插入到 bashfile 中,我应该可以工作
-
你也可以看看这个帖子stackoverflow.com/questions/2292847/…