我无法弄清楚这一点,我运行以下命令,第一个工作正常,然后我运行第二个,我得到许可被拒绝。我尝试过使用chmod()
但这不起作用,我很难过......
// This line works:
exec("$this->convert '$this->background' -resize 250 '$this->name'", $opt);
// This line gives permission denied:
exec("$this->mogrify xc:black -font '$font' -pointsize $font_size -draw \"text 240,10 '5'\" '$this->name'", $opt);
这是一个更好的外观:
protected $convert = "/usr/local/bin/convert";
protected $mogrify = "/usr/local/bin/mogrify";
public function display($format = Turing::JPG, $quality = 100){
// Create an image with a random background
exec("$this->convert '$this->background' -resize 250 '$this->name'", $opt);
$this->_buildText();
}
protected function _buildText(){
$text = $this->turing;
for($i = 0; $i < strlen($text); $i++){
$font = $this->getFont();
$angle = $this->getAngle();
$font_size = $this->getFont(35, 45);
if(stripos($font, "Kidnap_Note") !== false){
$font_size = $this->getFont(45, 50);
}
$x = (40 - ($this->step / 2) + $i * 45);
$y = 50;
$opt = null;
exec($q="$this->convert '$this->name' xc:black -font '$font' -pointsize $font_size -draw \"text 240,10 '{$text[$i]}'\" '$this->name'", $opt);
}
}