Somehow a child process quit after called Imagick::newImage


/ Published in: PHP
Save to your folder(s)

MacOS 10.6.5 PHP 5.3.3


Copy this code and paste it in your HTML
  1. <?php
  2. $image = new Imagick;
  3. $image->newImage(700, 394, 'red');
  4.  
  5. $pid = pcntl_fork();
  6. switch ($pid) {
  7. case 0:
  8. run();
  9. case -1:
  10. throw new Exception("fork failed!");
  11. default:
  12. break;
  13. }
  14. function run()
  15. {
  16. $image = new Imagick;
  17. echo 'hey', PHP_EOL;
  18. $image->newImage(700, 394, 'blue');
  19. echo 'doesnt reach...', PHP_EOL;
  20. $image->setImageFormat('jpeg');
  21. $image->setCompressionQuality(90);
  22. $image->writeImage('/tmp/hoge.jpg');
  23. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.