Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #21892 > unrolled thread
| Started by | Flavio Bosio <nospam@gmail.com> |
|---|---|
| First post | 2018-02-18 11:12 +0100 |
| Last post | 2018-02-18 11:22 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to it.comp.www.php
system() Flavio Bosio <nospam@gmail.com> - 2018-02-18 11:12 +0100
Re: system() Alessandro Pellizzari <shuriken@amiran.it> - 2018-02-18 11:22 +0000
| From | Flavio Bosio <nospam@gmail.com> |
|---|---|
| Date | 2018-02-18 11:12 +0100 |
| Subject | system() |
| Message-ID | <p6bjie$9db$1@gioia.aioe.org> |
Sia che faccia:
<?php
$myurl = 'file.pdf[0]';
$image = new Imagick($myurl);
$image->setResolution( 300, 300 );
$image->setImageFormat( "png" );
$image->writeImage('file.png');
?>
o
<?php
system("/usr/local/bin/convert -thumbnail 300x300 file.pdf[0] -flatten
file.png 2>&1",$output) ;
echo $output;
?>
il risultato non cambia:
convert: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER
-dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0
-dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4
-dGraphicsAlphaBits=4 '-r72x72' -dFirstPage=1 -dLastPage=1
'-sOutputFile=/var/tmp/magick-64945Fa6NtpJiWTeL%d'
'-f/var/tmp/magick-64945YjGbiI7dcEKD'
'-f/var/tmp/magick-64945VkiDEOkGudEq'' (1) @
error/pdf.c/InvokePDFDelegate/291. convert: no images defined `file.png'
@ error/convert.c/ConvertImageCommand/3275. 1
da linea di comando
/usr/local/bin/convert -thumbnail 300x300 file.pdf[0] -flatten file.png
funziona perfettamente
pare che PHP non riesca a trovare il path di ghostscript
idee?
[toc] | [next] | [standalone]
| From | Alessandro Pellizzari <shuriken@amiran.it> |
|---|---|
| Date | 2018-02-18 11:22 +0000 |
| Message-ID | <fet5v2FhvgqU1@mid.individual.net> |
| In reply to | #21892 |
On 18/02/18 10:12, Flavio Bosio wrote:
> pare che PHP non riesca a trovare il path di ghostscript
>
> idee?
Da shell:
$ echo $PATH
$ which gs
E da PHP:
<?php print getenv('PATH');
E vedi dove differiscono.
Bye.
[toc] | [prev] | [standalone]
Back to top | Article view | it.comp.www.php
csiph-web