@idevwebs opened this Issue on April 26th 2019

I have php ini_set function disabled. How can I use Matomo without it?

Error in Matomo: Matomo and Zend_Session require the ini_set() function It appears your PHP has disabled this function. To enjoy Matomo, you need remove ini_set from your disable_functions directive in php.ini, and restart your webserver.

@tsteur commented on April 27th 2019 Member

You would have to enable the method.

Alternatively, the only workaround is to create a bootstrap.php and add a method like

<?php
function ini_set($name, $value){}

Haven't tested it though. For future questions please ask in our forum: https://forum.matomo.org

@idevwebs commented on May 2nd 2019

Can't do that.

PHP Fatal error: Cannot redeclare ini_set()

I don't see why the use of the function can't be controlled with an option in config like: use_iniset=true|false with a note of the expected or needed values that should be set manually by the user in their ini if set to false.

I searched through the code and the use of the function is not very many. I simply commented out this block of code in: matomo/core/testMinimumPhpVersion.php

    // if (!function_exists('ini_set')) {
    //     $piwik_errorMessage .= "<p><strong>Matomo and Zend_Session require the <code>ini_set()</code> function</strong></p>
                //  <p>It appears your PHP has disabled this function.
                //  To enjoy Matomo, you need remove <pre>ini_set</pre> from your <pre>disable_functions</pre> directive in php.ini, and restart your webserver.</p>";
    // }

And I was able to login and view the dashboard.

@tsteur commented on May 2nd 2019 Member

We are currently using ini_set in a lot of places and it's not just simply adding a config setting to prevent calling it, we would also need to test everything still works when ini_set is disabled, we would need to ensure nothing breaks, maintain it, etc. Plus we're using libraries that maybe do an ini_set etc. I can currently only recommend to enable the ini_set feature.

This Issue was closed on April 27th 2019
Powered by GitHub Issue Mirror