Skip to main content

PECL install keeps defaulting to wrong PHP version

Comments

5 comments

  • cPRex Jurassic Moderator
    Hey there! That command you provided worked well for me on my system without needing to do anything else. I confirmed this with a PHP Info page on the domain, and it had the "imagick" section for PHP 7.4 The specific include gets added to /opt/cpanel/ea-php74/root/etc/php.d/zzzzzzz-pecl.ini, as that has the extension listed. The actual file should be in /opt/cpanel/ea-php74/root/usr/lib64/php/modules/imagick.so if you'd like to check and see if that is there. Did you get a positive confirmation from the Pecl install command? That output should have this as the last few lines: Build process completed successfully Installing '/usr/local/cpanel/3rdparty/php/74/include/php/ext/imagick/php_imagick_shared.h' Installing '/usr/local/cpanel/3rdparty/php/74/lib/php/extensions/no-debug-non-zts-20190902/imagick.so' install ok: channel://pecl.php.net/imagick-3.7.0 configuration option "php_ini" is not set to php.ini location You should add "extension=imagick.so" to php.ini
    although we add the "extension" code mentioned automatically.
    0
  • Cambreaker
    zzzzzzz-pecl.ini exists and has extension="imagick.so" extension=imagick.so But the /opt/cpanel/ea-php74/root/usr/lib64/php/modules/imagick.so does NOT exist, only in ea-php73. I think the only reason the pecl.ini has the imagick extension listed is because I created it manually when I first configured the module (for php73). I DO get the build completed successfully messages, but it always confirms the installation in php/73/, no matter what I do to try and prompt it to install in 74. Also, when I try to use the code > tag button, it just pops up a forum list instead of tagging the highlighted text, sorry :(
    0
  • cPRex Jurassic Moderator
    The code button being broken is a known issue - sorry about that. It sounds like you're doing everything right. Could you make a ticket with our support team so we can check this out directly on your machine?
    0
  • Cambreaker
    I received a resolution from support, sharing here for posterity! [QUOTE=cPanel Support]I found that your PECL service had configuration that was forcing PHP 7.3 to be used for the installation directory, even for PHP 7.4. This configuration is found here: [18:55:16 tra root@94483176 ~]cPs# /opt/cpanel/ea-php74/root/bin/pecl config-show | grep -i php73 PEAR executables directory bin_dir /opt/cpanel/ea-php73/root/usr/bin PHP CLI/CGI binary php_bin /opt/cpanel/ea-php73/root/usr/bin/php php.ini location php_ini /opt/cpanel/ea-php73/root/etc/php.ini
    When PECL would begin its process, it would use these PHP directories to be used instead of the version you specified, resulting in the extension being built for PHP 7.3. To resolve this, I simply moved this configuration file out of the way: [18:59:30 tra root@94483176 ~]cPs# mv -v /root/.pearrc{,.bak} "/root/.pearrc" -> "/root/.pearrc.bak"
    cPanel will manage your PECL configuration and this file is not normally required except for advanced requirements for PECL. As such, it is safe for this file to be disabled in this way. With this completed, attempting to install IMagick for PHP 7.4 showed success
    0
  • cPRex Jurassic Moderator
    I'm glad we were able to help track that down!
    0

Please sign in to leave a comment.