Symfony Exception

ErrorException

HTTP 500 Internal Server Error

file_exists(): open_basedir restriction in effect. File(unknown) is not within the allowed path(s): (/home/ghafoor2/domains/filenab.com/:/tmp/:/usr/local/php-7.4/lib/php/)

Exception

ErrorException

  1.         return $this;
  2.     }
  3.     public function get(string $fileName): array
  4.     {
  5.         if (! file_exists($fileName)) {
  6.             return [];
  7.         }
  8.         try {
  9.             $file = new File($fileName);
HandleExceptions->handleError(2, 'file_exists(): open_basedir restriction in effect. File(unknown) is not within the allowed path(s): (/home/ghafoor2/domains/filenab.com/:/tmp/:/usr/local/php-7.4/lib/php/)', '/home/ghafoor2/domains/filenab.com/vendor/facade/flare-client-php/src/Stacktrace/Codesnippet.php', 31, array('fileName' => 'unknown'))
  1.         return $this;
  2.     }
  3.     public function get(string $fileName): array
  4.     {
  5.         if (! file_exists($fileName)) {
  6.             return [];
  7.         }
  8.         try {
  9.             $file = new File($fileName);
  1.     public function toArray(): array
  2.     {
  3.         $codeSnippet = (new Codesnippet())
  4.             ->snippetLineCount(31)
  5.             ->surroundingLine($this->lineNumber)
  6.             ->get($this->file);
  7.         return [
  8.             'line_number' => $this->lineNumber,
  9.             'method' => $this->method,
  10.             'class' => $this->class,
<?php

namespace Facade\FlareClient\Stacktrace;

use 
Throwable;

class 
Stacktrace
{
    
/** @var \Facade\FlareClient\Stacktrace\Frame[] */
    
private $frames;

    
/** @var string */
    
private $applicationPath;

    public static function 
createForThrowable(Throwable $throwable, ?string $applicationPath null): self
    
{
        return new static(
$throwable->getTrace(),  $applicationPath$throwable->getFile(), $throwable->getLine());
    }

    public static function 
create(?string $applicationPath null): self
    
{
        
$backtrace debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS & ~DEBUG_BACKTRACE_PROVIDE_OBJECT);

        return new static(
$backtrace$applicationPath);
    }

    public function 
__construct(array $backtrace, ?string $applicationPath nullstring $topmostFile nullstring $topmostLine null)
    {
        
$this->applicationPath $applicationPath;

        
$currentFile $topmostFile;
        
$currentLine $topmostLine;

        foreach (
$backtrace as $rawFrame) {
            if (! 
$this->frameFromFlare($rawFrame) && ! $this->fileIgnored($currentFile)) {
                
$this->frames[] = new Frame(
                    
$currentFile,
                    
$currentLine,
                    
$rawFrame['function'] ?? null,
                    
$rawFrame['class'] ?? null,
                    
$this->frameFileFromApplication($currentFile)
                );
            }

            
$currentFile $rawFrame['file'] ?? 'unknown';
            
$currentLine $rawFrame['line'] ?? 0;
        }

        
$this->frames[] = new Frame(
            
$currentFile,
            
$currentLine,
            
'[top]'
        
);
    }

    protected function 
frameFromFlare(array $rawFrame): bool
    
{
        return isset(
$rawFrame['class']) && strpos($rawFrame['class'], 'Facade\\FlareClient\\') === 0;
    }

    protected function 
frameFileFromApplication(string $frameFilename): bool
    
{
        
$relativeFile str_replace('\\'DIRECTORY_SEPARATOR$frameFilename);

        if (! empty(
$this->applicationPath)) {
            
$relativeFile array_reverse(explode($this->applicationPath ?? ''$frameFilename2))[0];
        }

        if (
strpos($relativeFileDIRECTORY_SEPARATOR 'vendor') === 0) {
            return 
false;
        }

        return 
true;
    }

    protected function 
fileIgnored(string $currentFile): bool
    
{
        
$currentFile str_replace('\\'DIRECTORY_SEPARATOR$currentFile);

        
$ignoredFiles = [
            
'/ignition/src/helpers.php',
        ];

        foreach (
$ignoredFiles as $ignoredFile) {
            if (
strstr($currentFile$ignoredFile) !== false) {
                return 
true;
            }
        }

        return 
false;
    }

    public function 
firstFrame(): Frame
    
{
        return 
$this->frames[0];
    }

    public function 
toArray(): array
    {
        return 
array_map(function (Frame $frame) {
            return 
$frame->toArray();
        }, 
$this->frames);
    }

    public function 
firstApplicationFrame(): ?Frame
    
{
        foreach (
$this->frames as $index => $frame) {
            if (
$frame->isApplicationFrame()) {
                return 
$frame;
            }
        }

        return 
null;
    }

    public function 
firstApplicationFrameIndex(): ?int
    
{
        foreach (
$this->frames as $index => $frame) {
            if (
$frame->isApplicationFrame()) {
                return 
$index;
            }
        }

        return 
null;
    }
}