Installed PHP extensions to wrong PHP version

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















I just bought a VPS and it came with PHP5.3.3 and that wasn't good for our website, so I successfully (so it seemed, anyway) installed PHP5.6.7 and successfully registered it with Plesk.



For the website in question, I chose 5.6.7 in Plesk's hosting settings and everything worked fine. I can see by looking at phpinfo() that the correct version is being used.



After I was happy with that, I went on to install imagick and memcache, two other extensions needed for our site. Both seemed to install fine without any errors and added the extensions to the correct php.ini file (getting the correct path from phpinfo) and restarted apache:



extension=memcache;
extension=imagick;

$ service httpd restart


This is where I see things going wrong. I check phpinfo and the extensions are not visible, and I confirm this in my application:



if (extension_loaded('imagick')) 
echo 'IMagick extension loaded okay.';
else
echo 'IMagick extension not loaded! Meh!';



I then ran this command to find out which folder was being used for extensions:



$ php-config --extension-dir


It returns:



/usr/lib64/php/modules


But when I check my phpinfo for extensions_dir it that has this:



/php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226


I then investgated more by seeing which of these extension directories had an imagick.so extension; /usr/lib64/php/modules had the extension but the directory phpinfo is saying it should be in doesn't have the extension. I also confirmed this by going into Plesk and switching back to 5.3.3 and checked what phpinfo said. Both the extensions I installed were listed and worked fine! It installed ok, but for the wrong PHP version it seems.



I thought I would try copying the extension from where it is, to where it should be:



$ cp /usr/lib64/php/modules/imagick.so /php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226/imagick.so


And tested that the file existed in the new folder before restarting httpd - but again, without any luck.



It's very clear that the extensions, and possibly the modules, were installed into PHP5.3.3 directories, and not 5.6.7, but how did it happen? Should I have changed into cd /php/php-5.6.7 directory first and then ran the install commands? These are similar commands I used to install imagick, right after logging in as root:



$ yum install ImageMagick ImageMagick-devel
$ pecl install imagick
$ echo "extension=imagick.so" > /etc/php.d/imagick.ini


Can somebody very kindly share with me the commands needed to run a fresh, new imagick install, but to the correct PHP version? Or maybe share a way to easily fix the problem as it is?



I really appreciate any help to get me over the line on this problem.



This is the GIST I used for installing PHP5.6.7, in case that helps:



https://gist.github.com/Stayallive/dbb91ffa6f0fc6ca6ac3










share|improve this question


























    0















    I just bought a VPS and it came with PHP5.3.3 and that wasn't good for our website, so I successfully (so it seemed, anyway) installed PHP5.6.7 and successfully registered it with Plesk.



    For the website in question, I chose 5.6.7 in Plesk's hosting settings and everything worked fine. I can see by looking at phpinfo() that the correct version is being used.



    After I was happy with that, I went on to install imagick and memcache, two other extensions needed for our site. Both seemed to install fine without any errors and added the extensions to the correct php.ini file (getting the correct path from phpinfo) and restarted apache:



    extension=memcache;
    extension=imagick;

    $ service httpd restart


    This is where I see things going wrong. I check phpinfo and the extensions are not visible, and I confirm this in my application:



    if (extension_loaded('imagick')) 
    echo 'IMagick extension loaded okay.';
    else
    echo 'IMagick extension not loaded! Meh!';



    I then ran this command to find out which folder was being used for extensions:



    $ php-config --extension-dir


    It returns:



    /usr/lib64/php/modules


    But when I check my phpinfo for extensions_dir it that has this:



    /php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226


    I then investgated more by seeing which of these extension directories had an imagick.so extension; /usr/lib64/php/modules had the extension but the directory phpinfo is saying it should be in doesn't have the extension. I also confirmed this by going into Plesk and switching back to 5.3.3 and checked what phpinfo said. Both the extensions I installed were listed and worked fine! It installed ok, but for the wrong PHP version it seems.



    I thought I would try copying the extension from where it is, to where it should be:



    $ cp /usr/lib64/php/modules/imagick.so /php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226/imagick.so


    And tested that the file existed in the new folder before restarting httpd - but again, without any luck.



    It's very clear that the extensions, and possibly the modules, were installed into PHP5.3.3 directories, and not 5.6.7, but how did it happen? Should I have changed into cd /php/php-5.6.7 directory first and then ran the install commands? These are similar commands I used to install imagick, right after logging in as root:



    $ yum install ImageMagick ImageMagick-devel
    $ pecl install imagick
    $ echo "extension=imagick.so" > /etc/php.d/imagick.ini


    Can somebody very kindly share with me the commands needed to run a fresh, new imagick install, but to the correct PHP version? Or maybe share a way to easily fix the problem as it is?



    I really appreciate any help to get me over the line on this problem.



    This is the GIST I used for installing PHP5.6.7, in case that helps:



    https://gist.github.com/Stayallive/dbb91ffa6f0fc6ca6ac3










    share|improve this question
























      0












      0








      0








      I just bought a VPS and it came with PHP5.3.3 and that wasn't good for our website, so I successfully (so it seemed, anyway) installed PHP5.6.7 and successfully registered it with Plesk.



      For the website in question, I chose 5.6.7 in Plesk's hosting settings and everything worked fine. I can see by looking at phpinfo() that the correct version is being used.



      After I was happy with that, I went on to install imagick and memcache, two other extensions needed for our site. Both seemed to install fine without any errors and added the extensions to the correct php.ini file (getting the correct path from phpinfo) and restarted apache:



      extension=memcache;
      extension=imagick;

      $ service httpd restart


      This is where I see things going wrong. I check phpinfo and the extensions are not visible, and I confirm this in my application:



      if (extension_loaded('imagick')) 
      echo 'IMagick extension loaded okay.';
      else
      echo 'IMagick extension not loaded! Meh!';



      I then ran this command to find out which folder was being used for extensions:



      $ php-config --extension-dir


      It returns:



      /usr/lib64/php/modules


      But when I check my phpinfo for extensions_dir it that has this:



      /php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226


      I then investgated more by seeing which of these extension directories had an imagick.so extension; /usr/lib64/php/modules had the extension but the directory phpinfo is saying it should be in doesn't have the extension. I also confirmed this by going into Plesk and switching back to 5.3.3 and checked what phpinfo said. Both the extensions I installed were listed and worked fine! It installed ok, but for the wrong PHP version it seems.



      I thought I would try copying the extension from where it is, to where it should be:



      $ cp /usr/lib64/php/modules/imagick.so /php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226/imagick.so


      And tested that the file existed in the new folder before restarting httpd - but again, without any luck.



      It's very clear that the extensions, and possibly the modules, were installed into PHP5.3.3 directories, and not 5.6.7, but how did it happen? Should I have changed into cd /php/php-5.6.7 directory first and then ran the install commands? These are similar commands I used to install imagick, right after logging in as root:



      $ yum install ImageMagick ImageMagick-devel
      $ pecl install imagick
      $ echo "extension=imagick.so" > /etc/php.d/imagick.ini


      Can somebody very kindly share with me the commands needed to run a fresh, new imagick install, but to the correct PHP version? Or maybe share a way to easily fix the problem as it is?



      I really appreciate any help to get me over the line on this problem.



      This is the GIST I used for installing PHP5.6.7, in case that helps:



      https://gist.github.com/Stayallive/dbb91ffa6f0fc6ca6ac3










      share|improve this question














      I just bought a VPS and it came with PHP5.3.3 and that wasn't good for our website, so I successfully (so it seemed, anyway) installed PHP5.6.7 and successfully registered it with Plesk.



      For the website in question, I chose 5.6.7 in Plesk's hosting settings and everything worked fine. I can see by looking at phpinfo() that the correct version is being used.



      After I was happy with that, I went on to install imagick and memcache, two other extensions needed for our site. Both seemed to install fine without any errors and added the extensions to the correct php.ini file (getting the correct path from phpinfo) and restarted apache:



      extension=memcache;
      extension=imagick;

      $ service httpd restart


      This is where I see things going wrong. I check phpinfo and the extensions are not visible, and I confirm this in my application:



      if (extension_loaded('imagick')) 
      echo 'IMagick extension loaded okay.';
      else
      echo 'IMagick extension not loaded! Meh!';



      I then ran this command to find out which folder was being used for extensions:



      $ php-config --extension-dir


      It returns:



      /usr/lib64/php/modules


      But when I check my phpinfo for extensions_dir it that has this:



      /php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226


      I then investgated more by seeing which of these extension directories had an imagick.so extension; /usr/lib64/php/modules had the extension but the directory phpinfo is saying it should be in doesn't have the extension. I also confirmed this by going into Plesk and switching back to 5.3.3 and checked what phpinfo said. Both the extensions I installed were listed and worked fine! It installed ok, but for the wrong PHP version it seems.



      I thought I would try copying the extension from where it is, to where it should be:



      $ cp /usr/lib64/php/modules/imagick.so /php/php-5.6.7/lib/php/extensions/no-debug-non-zts-20131226/imagick.so


      And tested that the file existed in the new folder before restarting httpd - but again, without any luck.



      It's very clear that the extensions, and possibly the modules, were installed into PHP5.3.3 directories, and not 5.6.7, but how did it happen? Should I have changed into cd /php/php-5.6.7 directory first and then ran the install commands? These are similar commands I used to install imagick, right after logging in as root:



      $ yum install ImageMagick ImageMagick-devel
      $ pecl install imagick
      $ echo "extension=imagick.so" > /etc/php.d/imagick.ini


      Can somebody very kindly share with me the commands needed to run a fresh, new imagick install, but to the correct PHP version? Or maybe share a way to easily fix the problem as it is?



      I really appreciate any help to get me over the line on this problem.



      This is the GIST I used for installing PHP5.6.7, in case that helps:



      https://gist.github.com/Stayallive/dbb91ffa6f0fc6ca6ac3







      linux centos software-installation php






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 6 '15 at 1:17









      PaparazzoKidPaparazzoKid

      1012




      1012




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Uninstall PHP5.3.3 and than install imagemagic. Read what yum is printing on screen (if it is not trying to install PHP5.3.3 again).



          P.S.
          I just read what have you really done. You have compiled PHP5.6 and it is out of package manager support. Why did you need PHP5.6? You can have PHP5.4 on CentOS without compiling anything.






          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f194549%2finstalled-php-extensions-to-wrong-php-version%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Uninstall PHP5.3.3 and than install imagemagic. Read what yum is printing on screen (if it is not trying to install PHP5.3.3 again).



            P.S.
            I just read what have you really done. You have compiled PHP5.6 and it is out of package manager support. Why did you need PHP5.6? You can have PHP5.4 on CentOS without compiling anything.






            share|improve this answer



























              0














              Uninstall PHP5.3.3 and than install imagemagic. Read what yum is printing on screen (if it is not trying to install PHP5.3.3 again).



              P.S.
              I just read what have you really done. You have compiled PHP5.6 and it is out of package manager support. Why did you need PHP5.6? You can have PHP5.4 on CentOS without compiling anything.






              share|improve this answer

























                0












                0








                0







                Uninstall PHP5.3.3 and than install imagemagic. Read what yum is printing on screen (if it is not trying to install PHP5.3.3 again).



                P.S.
                I just read what have you really done. You have compiled PHP5.6 and it is out of package manager support. Why did you need PHP5.6? You can have PHP5.4 on CentOS without compiling anything.






                share|improve this answer













                Uninstall PHP5.3.3 and than install imagemagic. Read what yum is printing on screen (if it is not trying to install PHP5.3.3 again).



                P.S.
                I just read what have you really done. You have compiled PHP5.6 and it is out of package manager support. Why did you need PHP5.6? You can have PHP5.4 on CentOS without compiling anything.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 6 '15 at 7:47









                Bartek KosaBartek Kosa

                1012




                1012



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f194549%2finstalled-php-extensions-to-wrong-php-version%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)