-3

I'm setting up a Social Avatar Network Script website. but how do i fix this problem?

Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /home/flamore/domains/socialhaven.cal24.pl/public_html/index.php on line 21 Warning: require(__DIR__/../../../laravel/bootstrap/autoload.php): failed to open stream: No such file or directory in /home/flamore/domains/socialhaven.cal24.pl/public_html/index.php on line 21 Fatal error: require(): Failed opening required '__DIR__/../../../laravel/bootstrap/autoload.php' (include_path='.:/usr/local/lib/php') in /home/flamore/domains/socialhaven.cal24.pl/public_html/index.php on line 21 

I'm still a noob at php and I can't get SANS 2.0 to work!

a line of code: $app = require_once __DIR__ . "/../../../laravel/bootstrap/autoload.php";

hardillb
  • 47,764
  • 9
  • 59
  • 93
  • `__DIR__` will always be available. Only possible cause would have been using a PHP version < 5.3 – miken32 Jan 02 '20 at 16:35

1 Answers1

0

Try __DIR__ instead of DIR.

__DIR__ resolves to the current directory. DIR is a constant that is undefined that shows the error message.

EvE
  • 714
  • 3
  • 13
  • I actually used __ DIR __ . but when i copied and pasted it here it was missing. – Krzysztof J Dec 25 '18 at 11:01
  • Hold on, @KrzysztofJ: Copy'n'paste doesn't strip underlines. I think it's time that you create an actual [mcve], which is actually required here! As a new user, also take the [tour] and read [ask]. – Ulrich Eckhardt Dec 26 '18 at 17:39