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
Closed

PHP 7.2 imagick #26408

fridzema opened this issue Apr 10, 2018 · 15 comments
Labels
outdated PR was locked due to age

Comments

@fridzema
Copy link

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
Copy link
Member

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
Copy link
Author

@SMillerDev Solved it using pecl :)

@kikoseijo
Copy link

kikoseijo 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
Copy link

davidosuna1987 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
Copy link

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

@Somethingideally
Copy link

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
Copy link
Member

Did you try any of the suggestions in the thread?

@Somethingideally
Copy link

Somethingideally 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
Copy link
Member

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

@Somethingideally
Copy link

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
Copy link
Member

And you're getting this on the command line?

@Somethingideally
Copy link

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

@SMillerDev
Copy link
Member

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
Copy link

Nope, imagick.so is not a symlink

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

@Somethingideally
Copy link

Somethingideally 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 PR was locked due to age 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.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

5 participants