Want to subscribe to topics you're interested in?
Become a Member

PHP-FPM Ioncube on Centminmod ?

Discussion in 'Centmin Mod Insights' started by pamamolf, Jul 7, 2014.

  1. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    Hi

    Can i install Ioncube on Centminmod server so if a script need it to get it work?

    Is it easy or i have to do many adjustments?

    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    The install process for ioncube loader would be the same just specific paths would differ.

    I wrote a rough Centmin Mod standalone addon for ioncube.sh at https://gist.github.com/centminmod/e6454678e96687e97842 - haven't tested it much so only use on a test server first ;)

    Code:
    php --ri 'ionCube Loader'
    ionCube Loader
    Code:
    ls -lah ${CONFIGSCANDIR}
    total 32K
    drwxr-xr-x 2 root root 4.0K Jul  6 17:21 .
    drwxr-xr-x 3 root root 4.0K Jun 21 13:01 ..
    -rw-r--r-- 1 root root  252 Jul  6 17:21 igbinary.ini
    -rw-r--r-- 1 root root   21 Jul  6 17:21 imagick.ini
    -rw-r--r-- 1 root root   26 Jul  6 17:21 ioncube.ini
    -rw-r--r-- 1 root root   78 Jul  6 17:21 memcache.ini
    -rw-r--r-- 1 root root  115 Jul  6 17:21 memcached.ini
    -rw-r--r-- 1 root root  381 Jul  6 17:21 zendopcache.ini
    Code:
    ls -lah ${PHPEXTDIRD}
    total 4.7M
    drwxr-xr-x 2 root root 4.0K Jul  6 17:37 .
    drwxr-xr-x 5 root root 4.0K Jul  6 17:20 ..
    -rwxr-xr-x 1 root root 178K Jul  6 17:20 igbinary.so
    -rwxr-xr-x 1 root root 1.1M Jul  6 17:21 imagick.so
    -rwxr-xr-x 1 root root 1.2M Jul  6 17:37 ioncube.so
    -rwxr-xr-x 1 root root 455K Jul  6 17:21 memcache.so
    -rwxr-xr-x 1 root root 329K Jul  6 17:21 memcached.so
    -rwxr-xr-x 1 root root 999K Jul  6 17:20 opcache.a
    -rwxr-xr-x 1 root root 526K Jul  6 17:20 opcache.so
    ioncube_loader_centminmod_00.png
     
    Last edited: Jul 7, 2014
    • Like Like x 1
  3. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    Thanks that was fast :)
     
    Last edited: Jul 7, 2014
  4. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    Installation as:

    Code:
    chmod 0700 ioncube.sh
    ./ioncube.sh
    
    ?
     
  6. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    yup :)
     
    • Like Like x 1
  7. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    I just upload the file at centminmod addons folder and i got this:

    Code:
    [root@ns322300 addons]# ls
    avginstall.sh  geoip.sh  ioncube.sh  linfo.sh  passenger.sh  phpmyadmin.sh  python27_install.sh  wpcli.sh
    
    [root@ns322300 addons]# ./ioncube.sh
    -bash: ./ioncube.sh: /bin/bash^M: bad interpreter: No such file or directory
    [code]
    
    Why?
     
  8. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    has to be a unix file so try direct download instead

    Code:
    rm -rf ioncube.sh
    wget https://gist.githubusercontent.com/centminmod/e6454678e96687e97842/raw -O ioncube.sh
    chmod +x ioncube.sh
    ./ioncube.sh
     
  9. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    Installer working now but at the end i got this:

     
  10. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    what's the output of these commands

    Code:
    cat /etc/centminmod/php.d/ioncube.ini
    echo
    PHPEXTDIRD=`cat /usr/local/bin/php-config | awk '/^extension_dir/ {extdir=$1} END {gsub(/\047|extension_dir|=|)/,"",extdir); print extdir}'`
    ls -lah ${PHPEXTDIRD}
    PHP version ?
     
  11. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    php version 5.3.28

    Yes i think this is the problem i must adjust the addon to use the version for my php version....
     
  12. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    Maybe the script must check first the php version and then download the correct version?

    What can i do now to fix this?

    Thanks
     
  13. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
  14. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    zend_extension=ioncube.so

    PHPEXTDIRD=/usr/local/lib/php/extensions/no-debug-non-zts-20090626


    [root@ns322300 ~]# ls -lah ${PHPEXTDIRD}
    total 3.7M
    drwxr-xr-x 2 root root 4.0K Jul 7 22:52 .
    drwxr-xr-x 4 root root 4.0K Jul 5 17:43 ..
    -rwxr-xr-x 1 root root 732K Jul 5 17:43 apc.so
    -rwxr-xr-x 1 root root 174K Jul 5 17:43 igbinary.so
    -rwxr-xr-x 1 root root 1.1M Jul 5 17:46 imagick.so
    -rwxr-xr-x 1 root root 1018K Jul 7 22:52 ioncube.so
    -rwxr-xr-x 1 root root 315K Jul 5 17:46 memcached.so
    -rwxr-xr-x 1 root root 439K Jul 5 17:44 memcache.so
     
  15. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    that all looks good

    what is your installed PHP version's extension_dir path ? use below command to find it. It should match the ${PHPEXTDIRD} path

    Code:
    php -i | grep extension_dir
     
  16. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    Failed loading ioncube.so: ioncube.so: cannot open shared object file: No such file or directory
    extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20090626 => /usr/local/lib/php/extensions/no-debug-non-zts-20090626
    sqlite3.extension_dir => no value => no value
     
  17. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    that matches for extension_dir too so should work probably something i need to look into later

    you could try centmin.sh option 5 upgrade PHP to 5.4.30 and rerun the ioncube.sh and see if that works
     
  18. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    I can't as my friend needs to run on the 5.3.28 and i have already transfer the files and load the db there and we are need only the Ioncube now :(
     
  19. eva2000

    eva2000 Administrator Staff Member

    27,694
    6,324
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,320
    Local Time:
    11:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    one more thing to try is in /etc/centminmod/php.d/ioncube.ini change it so path is specified
    Code:
    zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ioncube.so
    then restart php-fpm
     
    • Like Like x 1
  20. pamamolf

    pamamolf Well-Known Member

    2,448
    220
    63
    May 31, 2014
    Ratings:
    +377
    Local Time:
    4:51 PM
    Nginx-1.11.x
    MariaDB 10
    Sorry for the delay but i am beta testing IPB 4 :)

    wow great working now and without any errors :)

    [root@ns322300 backup]# php -v
    PHP 5.3.28 (cli) (built: Jul 5 2014 17:41:27)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd.

    Can youplease add that fix to addon?