Error on production server #234
Replies: 5 comments 1 reply
-
@wolverine4277 what version of the package are you using? |
Beta Was this translation helpful? Give feedback.
-
Hi @patinthehat, is the last one, I download the package yesterday. |
Beta Was this translation helpful? Give feedback.
-
@wolverine4277 Take a look at this comment and let us know if it resolves your issue 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi @patinthehat , I already do that because the error named in the comment. Now I don't get any errores bit the script fails returning 500 error. |
Beta Was this translation helpful? Give feedback.
-
@wolverine4277 I believe your issue may be due to low resource limits specified in your Imagemagick seems to default to segfaulting when it runs out of memory, which would be the reason there are no error messages/logs. |
Beta Was this translation helpful? Give feedback.
-
Hi everybody!
In the development server this simple script to convert from PDF to image works fine:
But when i try on production server the script fails, error 500, no errors on PHP log file. In IIS log the error is:
2024-06-20 13:49:48 XXX.XXX.XXX.XXX GET /spatie/test.php - 80 - XXX.XX.XXX.XXX Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/126.0.0.0+Safari/537.36 - 500 0 258 300082
In both servers:
-Download ImageMagick PHP extension (8.3.3) having in mind the PHP version, the thread safety (NTS), and the architecture (x64). In my case https://downloads.php.net/~windows/pecl/releases/imagick/3.7.0/php_imagick-3.7.0-8.3-nts-vs16-x64.zip
-Extract from php_imagick-….zip the php_imagick.dll file, and save it to the ext directory of your PHP installation
-Extract from php_imagick-….zip the other DLL files (they may start with CORE_RL, FILTER, IM_MOD_RL, or ImageMagickObject depending on the version), and save them to the PHP root directory (where you have php.exe), or to a directory in your PATH variable
-Add this line to your php.ini file:
extension=php_imagick.dll
-Download and install Ghostcript (and rename the executable to gs.exe)
After run the script is that In the temp directory there are two temp files, the original PDF without extension and another of 1 byte size.
The problem is with the line 188 (pdf-to-image/src/Pdf.php):
$imageData = $this->getImageData($path, $page->number);
If a run this script all works fine.
I'm searching info in the web but i don't find a solution to this problem.
If anyone can help me with this problem, I would be very grateful.
Regards.
Sebastián
Beta Was this translation helpful? Give feedback.
All reactions