Search code examples
phpapacheioncube

How to prepend PHP file to ionCubed script


I've prepend a PHP file to all of script files using php.ini config:

auto_prepend_file = "./file.php"

Then I got this error while running script:

Site error: the file /home/user/public_html/path/index.php requires the
ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the website
operator. If you are the website operator please use the ionCube Loader Wizard
to assist with installation.

Since the script is encoded by ionCube, is there any way to make this okay?


just for more details, here is the file.php contents:

<?php
    $_SERVER['SERVER_ADDR'] = '100.101.102.103';
    $_ENV['SERVER_ADDR'] = '100.101.102.103';
    $HTTP_SERVER_VARS['SERVER_ADDR'] = '100.101.102.103';
?>

Solution

  • You need to setup the ionCube PHP Loader as the error message is telling you.

    1. Download the appropriate loader from here: http://www.ioncube.com/loaders.php

    2. Follow the docs to get it setup: http://www.ioncube.com/loader_installation.php

    3. There is a loader wizard that helps with the setup: http://www.ioncube.com/loader-wizard/loader-wizard.zip

    Once you have the ionCube PHP Loader working, the encoded script should just work.