I am deploying my laravel 5.4 project on a shared host using subdomain
I installed composer, changed paths of index.php , vendor paths , DB host, username , etc..
I am getting the following error
Fatal error: Uncaught UnexpectedValueException: There is no existing directory at “/storage/logs” and its not buildable: Permission denied in
/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:171
I tried the following commands :
php artisan cache:clear
php artisan clear-compiled
sudo chmod -R 777 storage/ -R
but (composer dump-autoload ) gives an error because php -v is 5 although I am choosing it to be 7 in the cpanel
I tried also setenforce 0
but nothing happened .. can any one help please??
2
Answers
php artisan route:clear
php artisan config:clear
php artisan cache:clear
works for me!
This is a Duplicate of: see here
.env
file :a) Check if you have
.env
file , if not copy-paste.env.example
to.env
b)
APP_DEBUG = true
(when deploying to a server, after checking your app – change on false)c)
APP_KEY =
(these must be empty)d) Save
.env
filee) Run
php artisan key:generate
f) Open your website (all another errors server return)
composer install
This is my solution for apache2 on Ubuntu 20.4
I assume you already did the Steps from phwt & Taras. These are still necessary.
You need to change:
ServerName
to your IP Address or DomainDocumentRoot
to the Path to your public Laravel directoryRewriteCond %{SERVER_NAME} =
to your IP Address or DomainFile:
/etc/apache2/sites-available/laravel.conf
After Saving this run:
(Optional, but recommended) If you want to use an SSL Cert do:
sudo certbot
and follow the instructions