无法访问主机中的 laravel
can't access laravel in hosting
我尝试在 byehost 中托管应用程序 laravel,但是当我访问时出现问题“糟糕,看起来出了点问题”。
env 文件内容:
APP_ENV=local APP_DEBUG=true APP_KEY=base64:nprtp1ROnlQoqIWKGp6MefyMwy8X0Oy/nczEbeBzaHo= APP_URL=http://localhost
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=DB_SAMPLE DB_USERNAME=root DB_PASSWORD=
CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379
MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null
您还需要生成应用密钥。只需 运行 php artisan key:generate
即可在本地生成密钥,然后只需将其复制到主机上的 .env
文件即可。
对存储文件夹授予权限
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
我尝试在 byehost 中托管应用程序 laravel,但是当我访问时出现问题“糟糕,看起来出了点问题”。
env 文件内容:
APP_ENV=local APP_DEBUG=true APP_KEY=base64:nprtp1ROnlQoqIWKGp6MefyMwy8X0Oy/nczEbeBzaHo= APP_URL=http://localhost
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=DB_SAMPLE DB_USERNAME=root DB_PASSWORD=
CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379
MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null
您还需要生成应用密钥。只需 运行 php artisan key:generate
即可在本地生成密钥,然后只需将其复制到主机上的 .env
文件即可。
对存储文件夹授予权限
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache