Search code examples
phplaraveldirectoryovh

__DIR__ not correct with Laravel 5.5 and OVH Shared Hosting


I made a website with Laravel 5.5 and Laravel Passport but I have a problem with login in Passport :

"Key path "file:///home/mylogin/mywebsite/storage/oauth-private.key" does not exist or is not readable"

I found it's nothing related to Passport or Laravel but it's related to __DIR__ constant. The __DIR__ constant in my website folder on OVH return :

/home/mylogin/mywebsite

Instead of :

/homez.141/mylogin/mywebsite

How is that possible ? And how should I proceed ?

Thanks for your help.


Solution

  • I found the solution.

    I made a mistake and the path was not in trouble (path changes but it's normal with OVH).

    I forgot to run php artisan passport:install, so a file was missing (because I work with an dev environment on my computer and I deploy via Github on OVH).