ImageMagick with MAMP 4 - mac mojave









up vote
0
down vote

favorite












I am trying to install ImageMagick for MAMP 4.



My php version is: 7.1.19
I went to applications/MAMP/bin/php/php7.1.12/conf/php.ini
and changed this line ;extension=imagick.so to extension=imagick.so.
I also have a php folder in there of php7.2.1 so I did the above change there too. I restarted MAMP.



After doing that phpinfo told me that ImageMagick is present:



enter image description here



However when I try to run a line of code like this:



header('Content-type: image/jpeg');

$im = new Imagick("test.png");


I received the error localhost is unable to handle this request, if I remove these lines of code then the page loads fine.



I have also installed ImageMagick, imagemagick 7.0.8-14 is already installed and up-to-date.










share|improve this question



















  • 2




    You need to tell PHP that the Imagick namespace is built-in with a back slash: $im = new Imagick("test.png"); Note back slash before Imagick
    – Jamie_D
    Nov 10 at 13:42











  • Possible duplicate of How to get useful error messages in PHP?
    – miken32
    Nov 10 at 18:56














up vote
0
down vote

favorite












I am trying to install ImageMagick for MAMP 4.



My php version is: 7.1.19
I went to applications/MAMP/bin/php/php7.1.12/conf/php.ini
and changed this line ;extension=imagick.so to extension=imagick.so.
I also have a php folder in there of php7.2.1 so I did the above change there too. I restarted MAMP.



After doing that phpinfo told me that ImageMagick is present:



enter image description here



However when I try to run a line of code like this:



header('Content-type: image/jpeg');

$im = new Imagick("test.png");


I received the error localhost is unable to handle this request, if I remove these lines of code then the page loads fine.



I have also installed ImageMagick, imagemagick 7.0.8-14 is already installed and up-to-date.










share|improve this question



















  • 2




    You need to tell PHP that the Imagick namespace is built-in with a back slash: $im = new Imagick("test.png"); Note back slash before Imagick
    – Jamie_D
    Nov 10 at 13:42











  • Possible duplicate of How to get useful error messages in PHP?
    – miken32
    Nov 10 at 18:56












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to install ImageMagick for MAMP 4.



My php version is: 7.1.19
I went to applications/MAMP/bin/php/php7.1.12/conf/php.ini
and changed this line ;extension=imagick.so to extension=imagick.so.
I also have a php folder in there of php7.2.1 so I did the above change there too. I restarted MAMP.



After doing that phpinfo told me that ImageMagick is present:



enter image description here



However when I try to run a line of code like this:



header('Content-type: image/jpeg');

$im = new Imagick("test.png");


I received the error localhost is unable to handle this request, if I remove these lines of code then the page loads fine.



I have also installed ImageMagick, imagemagick 7.0.8-14 is already installed and up-to-date.










share|improve this question















I am trying to install ImageMagick for MAMP 4.



My php version is: 7.1.19
I went to applications/MAMP/bin/php/php7.1.12/conf/php.ini
and changed this line ;extension=imagick.so to extension=imagick.so.
I also have a php folder in there of php7.2.1 so I did the above change there too. I restarted MAMP.



After doing that phpinfo told me that ImageMagick is present:



enter image description here



However when I try to run a line of code like this:



header('Content-type: image/jpeg');

$im = new Imagick("test.png");


I received the error localhost is unable to handle this request, if I remove these lines of code then the page loads fine.



I have also installed ImageMagick, imagemagick 7.0.8-14 is already installed and up-to-date.







php imagemagick mamp php-7 imagick






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 13:43

























asked Nov 10 at 13:38









Otto

1178




1178







  • 2




    You need to tell PHP that the Imagick namespace is built-in with a back slash: $im = new Imagick("test.png"); Note back slash before Imagick
    – Jamie_D
    Nov 10 at 13:42











  • Possible duplicate of How to get useful error messages in PHP?
    – miken32
    Nov 10 at 18:56












  • 2




    You need to tell PHP that the Imagick namespace is built-in with a back slash: $im = new Imagick("test.png"); Note back slash before Imagick
    – Jamie_D
    Nov 10 at 13:42











  • Possible duplicate of How to get useful error messages in PHP?
    – miken32
    Nov 10 at 18:56







2




2




You need to tell PHP that the Imagick namespace is built-in with a back slash: $im = new Imagick("test.png"); Note back slash before Imagick
– Jamie_D
Nov 10 at 13:42





You need to tell PHP that the Imagick namespace is built-in with a back slash: $im = new Imagick("test.png"); Note back slash before Imagick
– Jamie_D
Nov 10 at 13:42













Possible duplicate of How to get useful error messages in PHP?
– miken32
Nov 10 at 18:56




Possible duplicate of How to get useful error messages in PHP?
– miken32
Nov 10 at 18:56

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239531%2fimagemagick-with-mamp-4-mac-mojave%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239531%2fimagemagick-with-mamp-4-mac-mojave%23new-answer', 'question_page');

);

Post as a guest














































































Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線