I want to preface this question with the fact that

My task was this: view an image in a browser, click on something in the image, have perl run an ImageMagick command to modify the image.

It's not a great setup, but it's worked for me before. The problem is that I'm doing it on an M2 Mac.

This is basically it:

my $command = "/opt/local/bin/convert foo.jpg -crop ${w}x$h+$x+$x ./cr +opped/foo.jpg"; my $result = `$command`; say qq|{"result":"$result"}|;

So on my M2 mac, I get 6 as the result, and the convert doesn't work.

I solved the problem by just implementing it on an older Mac.

But what's going on here? My Apache is the XAMPP one:

Server version: Apache/2.4.56 (Unix) Server built: Oct 28 2023 12:23:23 Server's Module Magic Number: 20120211:126 Server loaded: APR 1.5.2, APR-UTIL 1.5.4, PCRE 8.44 2020-02-12 Compiled using: APR 1.5.2, APR-UTIL 1.5.4, PCRE 8.44 2020-02-12 Architecture: 64-bit Server MPM: prefork threaded: no forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_FLOCK_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/usr" -D SUEXEC_BIN="/usr/bin/suexec" -D DEFAULT_PIDLOG="/private/var/run/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types" -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

My perl is:

Platform: osname=darwin osvers=22.0 archname=darwin-thread-multi-2level uname='darwin 5bxbb.p1s.plx.sd.apple.com 22.0 darwin kernel versio +n 22.1.0: thu dec 15 17:42:24 pst 2022; root:xnu-8792.41.9.100.2~1dev +elopment_x86_64 x86_64 ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= +-Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc +=cc'

My ImageMagick is:

Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagi +ck.org

So, for some reason, that combination doesn't work and the system returns 6 which seems to mean "no such binary"?

Help me understand what's going on here Monks, and how I can resolve things like this in the future without having to return to an older Mac system?


In reply to Perl on M2 Mac issues: somewhere between Perl, Apache and ImageMagick my code fails by LittleJack

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.