Reputation: 483
I don't want the file in my root directly to be hidden that include .env file of laravel maybe with .htaccess or any other way i have am trying to host it bt i don't want some to go to mysite.com/.env
APP_ENV=local
APP_KEY=base64:w8nPcK6CVaazC/WEv42hf+QOs4zWg2izt1pubH0KnQE=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
I have this error from my server.
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/skycashs/public_html/public/index.php on line 50
Upvotes: 0
Views: 1129
Reputation: 163898
You need to point web server (Apache or nginx) to the public
directory which is inside Laravel project root
You're using wrong web server configuration. Point your web server to a public directory and restart it.
An example for Apache web server:
DocumentRoot "/project_root/public"
<Directory "/project_root/public">
And for nginx:
root /project_root/public;
Don't forget to restart web server to make changes work.
Upvotes: 2