doujiu8145 2016-10-27 10:32
浏览 79
已采纳

Imagick安装但没有从apache加载?

I am a bit confused. If I run a script it works both from php-built-in server and from console.

$img = new Imagick();
var_dump($img);

But if I run

<?php phpinfo();

Apache do not see imagick. I use it in a Symfony application that sometimes return this error log:

[2016-10-27 12:03:30] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: "Attempted to load class "Imagick" from the global namespace. Did you forget a "use" statement?" at /Volumes/Sviluppo/bitbucket.org/.../.../vendor/imagine/imagine/lib/Imagine/Imagick/Imagine.php line 39 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ClassNotFoundException(code: 0): Attempted to load class \"Imagick\" from the global namespace. Did you forget a \"use\" statement? at /Volumes/Sviluppo/bitbucket.org/.../.../vendor/imagine/imagine/lib/Imagine/Imagick/Imagine.php:39)"} []

I wondered in imagick.ini file

$ php -i | grep ini | grep ima
Additional .ini files parsed => /usr/local/etc/php/7.0/conf.d/ext-imagick.ini,

that contains

$ cat /usr/local/etc/php/7.0/conf.d/ext-imagick.ini
[imagick]
extension="/usr/local/opt/php70-imagick/imagick.so"

File exists!!!

PHP Version from cli is

$ php -v
PHP 7.0.12 (cli) (built: Oct 14 2016 09:55:03) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans

But phpinfo() show me 7.0.11.

Finally, ... configuration loaded is php5 configuration. LOL. How can I move all my php to the same version?

phpinfo output

  • 写回答

1条回答 默认 最新

  • douzhe1264 2016-10-27 10:42
    关注

    Why does php -v on the command line still show my old version?

    php-osx doesn't overwrite the php binaries installed by Apple, but installs everything in /usr/local/php5. The new php binary is therefore in /usr/local/php5/bin/php.

    You can also adjust your PATH do include that directory, eg. write into your ~/.profile file the following

    export PATH=/usr/local/php5/bin:$PATH
    

    Included extensions

    bcmath bz2 calendar Core ctype curl date dom dtrace ereg exif fileinfo filter ftp gd gettext hash iconv imap intl json ldap libxml mbstring mcrypt memcache memcached mhash mongo mssql mysql mysqli mysqlnd OAuth odbc openssl pcntl pcre PDO pdo_dblib pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix Reflection session shmop SimpleXML soap sockets solr SPL SQLite sqlite3 standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xdebug xhprof xml xmlreader xmlrpc xmlwriter xsl zip zlib Xdebug

    available but disabled by default: apc, xslcache, twig, uploadprogress

    Consider reading the documentation @ https://php-osx.liip.ch/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog