Installing PHP extensions on shared hosting

后端 未结 4 1002
渐次进展
渐次进展 2021-02-15 16:24

I need to enable the mcrypt functions on my website, except I\'m on a shared host (running linux) and obviously don\'t have access to the php.ini file. There does s

相关标签:
4条回答
  • 2021-02-15 16:47

    dl() will not help you either, since it only loads libraries from certain paths, and those paths are usually only writable by the system administrators for security reasons.

    I very much doubt that there is a way to use binary libraries without the consent of the hoster.

    0 讨论(0)
  • 2021-02-15 16:48

    The MCrypt Sourceforge page should have it http://mcrypt.sourceforge.net/
    To compile it just:

    wget http://superb-east.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz
    tar -xzvf libmcrypt-2.5.8.tar.gz
    cd libmcrypt-2.5.8
    ./configure
    make
    sudo make install
    

    EDIT: Can you reference it with a direct path?
    What have you tried?

    Edit2: It seems that you can only load moduals from the extensions directory set in the php.ini and you cannot override extensions_dir with ini_set so you will either have to convince your host to install it or if they allow you to have your own php.ini (many do usually in [username]/php.ini) then you could set the extensions_dir in there and load the modual with that.

    0 讨论(0)
  • 2021-02-15 16:51

    Really the best way is to tell your ISP to include mcrypt support. Even if you bundle your own PHP extension and load it with dl(), there is no guarantee it is going to work after a PHP upgrade, as PHP is sometimes very version-number picky.

    0 讨论(0)
  • 2021-02-15 17:01

    PHP in versions before 5.2.5 allowed you to use a path in the dl() function so that you could easily load libraries in a shared environment.

    This changed for 'security' reasons with 5.2.5 and as far as I am aware your only option is to get your system administrator to add the module to the extensions_dir.

    This issue is described at bugs.PHP.net

    0 讨论(0)
提交回复
热议问题