It looks like __DIR__
isn't getting parsed, are you sure your host isn't running PHP 5.2.* if you run phpinfo()
on your host what version does it give?
__DIR__
is only available from PHP 5.3.0 onwards
Question
I am working on deploying a Laravel app to a bluehost server and I am running into some trouble.
Currently, I uploaded all of the Laravel files to the root of the server, then uploaded the contents of the "public" folder to the "public_html" folder. From here I opened the "bootstrap/paths.php" file and changed the public path to
'public' => __DIR__.'/../public_html',
After this, I am still unable to get content to display. Am I missing something? It looks like bluehost is running PHP 5.4.24.
Any help with this would be appreciated.
Thanks!
EDIT: The error log shows
[09-Apr-2014 09:04:02] PHP Fatal error: require() [function.require]: Failed opening required 'DIR/../bootstrap/autoload.php' (include_path='.:/usr/lib64/php:/usr/share/pear') in /home1/regmuel/public_html/index.php on line 21
Could anyone help me figure this error out. I can clearly see what the problem is, I'm just not sure how to go about fixing it.
Solution
It looks like __DIR__
isn't getting parsed, are you sure your host isn't running PHP 5.2.* if you run phpinfo()
on your host what version does it give?
__DIR__
is only available from PHP 5.3.0 onwards
OTHER TIPS
RMcLeod's answer is perfect, just wanted to add to it something that I ran into with my web host (specifically Bluehost). Even after the version of PHP running on the server was 5.4.40 (found using php -v via an SSH
terminal), I was running into the same problem where it was picking up an older version of PHP when interpreting my index.php
and wouldn't recognize the DIR constant.
I had to add the line
AddHandler application/x-httpd-php54s .php
to the top of the .htaccess
file which is in the same folder as my index.php
Just for context, I was trying to set up my laravel 4.2 app on bluehost and it relies heavily on this constant.