Invalid magic __DIR__ value

I am trying to install a web application that is built using the Laravel framework. The app is hosted as a GIT repository.

Here is a detailed description of my problem to figure out how I ran into it.

The first time I cloned the repository along the following path:

/var/www/app.example.com/script/

Then I created a symbolic link to it in a directory public

like this to follow my server-side routing convention nginx

:

ln -s /var/www/app.example.com/script/public /var/www/app.example.com/public_html

      

But I decided to move everything from the directory script

to one top level and this is where my problem started.
I moved my Laravel installation to /var/www/app.example.com/

and made nginx to directly download its directory public

as root path.

Now the problem is that every time I try to load the app it tries to read files from its previous location:

Warning: Required (/var/www/app.example.com/ script / public /../ bootstrap / autoload.php): Could not open stream: No such file or directory in /var/www/app.example.com /public/index.php on line 21

Fatal error: require (): failed open '/var/www/app.example.com/ script / public /../ bootstrap / autoload.php' (include_path = '.: / Usr / share / php: / usr / share / pear ') to /var/www/app.example.com/public/index.php on line 21

Notes to keep in mind:

  • I used composer to install all dependencies

    curl -sS https://getcomposer.org/installer | PHP
    php composer.phar install

  • I am using nginx

    as my web server

  • I tried deleting everything (including ~/.composer

    ) and starting over to no avail.
  • I even tried to move the whole project to the new root directory
  • The problem seems to be with the magic constant __DIR__

    as it contains the wrong path
  • Strange enough if I echo it __DIR__

    prints the correct path, but the next line where it was used has the wrong old path

Hopefully I've been clear enough in my description to avoid confusion and possible downside voices.

+3


source to share


1 answer


So, I might be completely wrong, but is there a config file where he could save it? Or is there something else left in the directory script

that could lead to this? Since when it __DIR__

outputs the correct value, it should also be in other code.



0


source







All Articles