• The minification depends on the $_SERVER[“DOCUMENT_ROOT”] as in ‘w3-total-cache/lib/Minify/Minify/Controller/MinApp.php’

    if (0 === strpos($file, '//')) { $file = $_SERVER['DOCUMENT_ROOT'] . substr($file, 1); } $realpath = \W3TC\Util_Environment::realpath($file);

    $_SERVER[“DOCUMENT_ROOT”] is not the file system root, it is the site’s document root as configured in your web server.

    So in wicked cases (eg. shared hosting) it could probably fail. And it failed in my development server. The $_SEVER[“DOCUMENT_ROOT”] and DIR on root script had different paths… I fixed on my case by changing the DOCUMENT_ROOT manually. It would be better if the author can have a look on this issue.

    You can see the debug info on this link Debug screenshot

    Thx
    Laxman

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @thapalaxman,

    Yes, we are aware of this. I spoke with the team and this is considered as a low priority issue. We will be working on this in the future.

    Thread Starter thapa.laxman

    (@thapalaxman)

    Thx @vmarko for the update. I will keep this thread as not resolved for now because $_SEVER["DOCUMENT_ROOT"] is not a reliable way and it breaks website as in my case. $_SEVER["DOCUMENT_ROOT"] also does not work with cli. A good way would be to use dirname(__FILE__) or __DIR__.

    Thx
    Laxman

    • This reply was modified 4 years, 11 months ago by thapa.laxman.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The minification does not work if $_SERVER[“DOCUMENT_ROOT”] is incorrectly confi’ is closed to new replies.