torchlight-api / torchlight-laravel

A Laravel client for Torchlight - the syntax highlighting API.
https://torchlight.dev
MIT License
113 stars 17 forks source link

is_file(): open_basedir restriction in effect on shared hosting #49

Open diamondobama opened 1 year ago

diamondobama commented 1 year ago

Torchlight doesn't work on shared hosting. I'm getting the below error:

[2023-08-12 14:29:53] production.ERROR: is_file(): open_basedir restriction in effect. File(/##LARAVEL_TRIM_FIXER##[
    {
        "message": "Test message"
    }
]) is not within the allowed path(s): (/usr/www/wwws/users/xxxxxxxx:/usr/wwws/users/xxxxxxxx:/usr/www/users/xxxxxxxx:/usr/home/xxxxxxxx:/usr/local/rmagic:/usr/share/php:/usr/local/lib/php:/tmp:/usr/bin:/usr/local/bin:/usr/local/share/www:/usr/www/share/www:/usr/share/misc:/dev/urandom:/var/www/php_profiler/xhgui) {"view":{"view":"/usr/www/users/xxxxxxxx/storage/framework/views/e27a4533eb8db3852c74356c2d86f009b7ba2033.blade.php","data":{"errors":"<pre class=sf-dump id=sf-dump-1706485823 data-indent-pad=\"  \"><span class=sf-dump-note>Illuminate\\Support\\ViewErrorBag</span> {<a class=sf-dump-ref>#1682</a><samp data-depth=1 class=sf-dump-expanded>
  #<span class=sf-dump-protected title=\"Protected property\">bags</span>: []
</samp>}

If I comment out the below in Manager.php it works fine:

if (is_file($directory . $file)) {
    return file_get_contents($directory . $file);
}