Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.2 imagick #26408

Closed
fridzema opened this issue Apr 10, 2018 · 15 comments

Comments

@fridzema
Copy link

commented Apr 10, 2018

Hello,

I really don't know if this is correct place to ask this, but the old homebrew-php is deprecated...
I am running osx 10.13.3 and php 7.2.4 and cant get it to work with imagick.
I used to do a simple php(version)-imagick and it works, but php72-imagick doesn't exists anymore.

Anyone has a workaround or fix for this?

@SMillerDev

This comment has been minimized.

Copy link
Member

commented Apr 10, 2018

A lot of extensions are now part of the php binary itself (check php -m) if you want to install another extension you should use pecl.

@fridzema

This comment has been minimized.

Copy link
Author

commented Apr 10, 2018

@SMillerDev Solved it using pecl :)

@fridzema fridzema closed this Apr 10, 2018

@raphaelsaunier raphaelsaunier referenced this issue Apr 11, 2018
1 of 1 task complete
@kikoseijo

This comment has been minimized.

Copy link

commented Apr 15, 2018

Im trying to use the pecl but does not compile, this is how I solved, in case its of help of anyone.

brew install imagemagick
brew install pkg-config
pecl install imagick

and finally:

Build process completed successfully
Installing '/usr/local/Cellar/php/7.2.4_1/include/php/ext/imagick/php_imagick_shared.h'
Installing '/usr/local/Cellar/php/7.2.4_1/pecl/20170718/imagick.so'
install ok: channel://pecl.php.net/imagick-3.4.3
Extension imagick enabled in php.ini
@davidosuna1987

This comment has been minimized.

Copy link

commented Apr 25, 2018

Hello @kikoseijo , I'm doing your steps but I'm having the following error:
PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/Cellar/php/7.2.4_1/lib/php/20170718/imagick.so (dlopen(/usr/local/Cellar/php/7.2.4_1/lib/php/20170718/imagick.so, 9): image not found), /usr/local/Cellar/php/7.2.4_1/lib/php/20170718/imagick.so.so (dlopen(/usr/local/Cellar/php/7.2.4_1/lib/php/20170718/imagick.so.so, 9): image not found)) in Unknown on line 0

Any idea how can I solve this?

Thank you!

EDIT: Issue is solved

I did not add the following line in the php.ini file:
extension = "imagick.so"

That's all 😀

@kikoseijo

This comment has been minimized.

Copy link

commented Apr 25, 2018

Or a simple php restart, i didn't had to change anything in php.ini
Glad you got it working.

@Somethingideally

This comment has been minimized.

Copy link

commented May 3, 2018

PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so' - dlopen(/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so, 9): no suitable image found.  Did find:
	/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so: file too short in Unknown on line 0

any ideas???

@SMillerDev

This comment has been minimized.

Copy link
Member

commented May 3, 2018

Did you try any of the suggestions in the thread?

@Somethingideally

This comment has been minimized.

Copy link

commented May 3, 2018

ye, im completed with pecl

Installing '/usr/local/Cellar/php@7.1/7.1.17/include/php/ext/imagick/php_imagick_shared.h'
Installing '/usr/local/Cellar/php@7.1/7.1.17/pecl/20160303/imagick.so'
install ok: channel://pecl.php.net/imagick-3.4.3
Extension imagick enabled in php.ini

but still has that error

@SMillerDev

This comment has been minimized.

Copy link
Member

commented May 3, 2018

Do you have you extension directory in php.ini set to /usr/local/lib/php/pecl/<apib version>/?

@Somethingideally

This comment has been minimized.

Copy link

commented May 3, 2018

yes, i have 20160303 DIR
and file
/usr/local/Cellar/php@7.1/7.1.17/pecl/20160303/imagick.so
also exists, but
/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so: file too short in Unknown on line 0

@SMillerDev

This comment has been minimized.

Copy link
Member

commented May 3, 2018

And you're getting this on the command line?

@Somethingideally

This comment has been minimized.

Copy link

commented May 3, 2018

yes, im getting this error while using
php -v
P. S. i need php-imagemagick for project =(

@SMillerDev

This comment has been minimized.

Copy link
Member

commented May 3, 2018

Is /usr/local/Cellar/php@7.1/7.1.17/pecl/20160303/imagick.so a symlink? Cause Google tells me that sometimes gives the "file too short error" (none of this is homebrew issues by the way). And a lot of stack overflow solutions relating to shared libraries and "file too short" are just reinstalling the software.

@Somethingideally

This comment has been minimized.

Copy link

commented May 3, 2018

Nope, imagick.so is not a symlink

total 832
-rw-r--r--  1 o.guz  staff  422456 May  3 14:42 imagick.so
@Somethingideally

This comment has been minimized.

Copy link

commented May 3, 2018

Fixed this issue with next steps:

  1. Create in /usr/local/etc/php/7.1/conf.d file named ext-imagick.ini
    with content:
[imagick]
extension="/usr/local/Cellar/php@7.1/7.1.17/pecl/20160303/imagick.so"
  1. brew services restart php@7.1

Thanks for answers.
Maybe this information will be helpful for someone.

@lock lock bot added the outdated label Jun 7, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.