php artisan storage:link linking wrong directory - laravel

I need advice to setup php artisan storage:link in my .ebextensions/setup.config. Currently, after the command being executed my storage folder are linked under path "/var/app/ondeck/storage/app/public" instead of "/var/www/html/storage/app/public". Below are my setup configuration.
06-link_storage:
command: "php artisan storage:link"
cwd: "/var/app/ondeck"
Here's a screenshot of the path linked in one of my instances.
I've also tried changing the path to /var/www/html. However the path link also invalid.
06-link_storage:
command: "php artisan storage:link"
cwd: "/var/www/html"
Any help or advice would mean a lot to me. Thanks.

Related

Laravel8 storage files not found

php artisan storage:link
local worked fine.
After deployment without start php artisan serve it doesnt find the files in storage.
Symlink is online.
ok if I make symlink on my own it worked fine.
use
ln -s ../storage/app/public storage
instead of
php artisan storage:link
If you have access to ssh or to the remote terminal:
php artisan storage:link
php artisan config:clear

file_put_contents(C:\xampp\htdocs\instant\storage\framework/sessions/FF): failed to open stream: No such file or directory

I was trying to upload this instance on Amazon elasticBeanstalk, but it doesn't seem to work.
I have tried using ssh to access the files to no avail.
i did php artisan config:cache and composer dump-autoload before uploading.
Any help is appreciated.
Go to directory laravel/bootstrap/cache and delete config.php file.
Open terminal in your project directory and run this cmd:
php artisan config:clear
How did I solve this issue? After running those commands and not getting the solution.
composer dump-autoload
composer install
php artisan cache:clear
php artisan config:clear
php artisan optimize
php artisan clear-compiled
The issue was simple. In my case under storage/framework there is sessions folder is missing so I created the directory and run the command again. And issue solved.
**Note: In some cases if your run php artisan cache:clear and php artisan config:clear. Your issue will be solved.
Hope this thread will solve your issue.
Happy Coding :)
Can try using php artisan optimize. This will clear everything that cache your projects.
Let me know if this help you guys. Thanks!
run php artisan vendor:publish
Asking Which provider or tag's files would you like to publish?:
Type 0
Then run php artisan serve
This command work in my case: php artisan config: clear
It worked for me when i changed all paths in C:\xampp\htdocs...\bootstrap\cache\config.php

Laravel completely ignoring my config file

So, I'm trying to use Intervention Image with the Imagick driver.
I've done php artisan vendor:publish, and selected Intervention, and now config/image.php exists. I've changed 'driver' => 'gd' to 'driver' => 'imagick', but nothing at all happens.
I then tried php artisan config:cache, same thing.
Then composer dump-autoload, then php artisan cache:clear and any other combinations of the above.
I can put literally anything in this file, fill the array with invalid syntax, junk etc, and it's completely ignored.
Is there something I'm missing? I've tried everything I'm aware of.
Please delete cache folder from bootstrap folder and create new empty cache folder in bootstrap folder after run below command
php artisan config:cache
php artisan cache:clear
Please try with:
php artisan config:clear
The config:clear command is used to remove the configuration cache file created by the config:cache command. By default this command will delete the bootstrap/cache/config.php file.

There is no existing directory at /storage/logs and its not buildable: Permission denied

I have a problem with my Laravel deployment on a OVH web server.
After made
composer update
php artisan cache:clear
php artisan route:clear
php artisan dump-autoload
I have this answer:
There is no existing directory at /storage/logs and its not buildable: Permission denied
I put all the files on 777 chmod but I have always this answer.
Please try the following commands
php artisan route:clear
php artisan config:clear
php artisan cache:clear
Note: In case you are a Homestead & VirtualBox user, please be sure that your VirtualBox is up to date.
It helped in this thread at laracasts
Clear the cache and config, then deploy to the live server.
If you've already uploaded to the live server, then you have to follow these steps:
Delete bootstrap/cache/config.php
Delete all log files in storage/logs.
You don't need to add any permission on the storage file.
The main problem here is in the compiled file, and due to which laravel try to show an error.
By default in laravel, storage file not having permission to show in the console (error
shows from the error.log file).
So the thing you need to fix is to fix compile file. which can be done thought this single command
Use this
php artisan optimize:clear
This command will clear all your cache
Compiled views
Application cache
Route cache
Configuration cache
After changing local conf i got the same error over and over,
try this, probably will help.
rm bootstrap/cache/config.php
and then
php artisan cache:clear
depending on your scenario, reloading auto-loader file can solve your issue, for that use :
composer dump-autoload
or sometimes just try :
composer install
this do the two the commands listed above.
go to your vagrant
then run
vagrant ssh
php artisan config:cache
Run the following command if you can access your server terminal
php artisan route:clear && php artisan cache:clear && php artisan config:clear && php artisan config:cache
If you are on shared hosting and cant access the terminal go to your web route file in routes/web.php and make a temporary link such as shown:
Route::get('reset', function (){
Artisan::call('route:clear');
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('config:cache');
});
Then go to http://your-domain/reset to execute the commands. there after you can now access your website as normal
If you are using homestead (vagrant) in Laravel then follow the steps #Farid shahidi provided
vagrant ssh
cd /home/vagrant/code <-- your file usually resides here; see your Homestead.yaml configuration
php artisan config:cache
You Have to try artisan command in this way
php artisan cache: clear
php artisan config:cache
php artisan cache: clear
This one-line command solves my issue:
php artisan config:cache
Delete bootstrap/cache/config.php from your laravel deployment on the server.
Please run the below commands:
php artisan route:clear
php artisan config:clear
php artisan cache:clear
This one worked for me in case your project is located within /var/www/html/
sudo chmod -Rf 0777 /var/www/html/{project-name}/bootstrap/cache
sudo chmod -Rf 0777 /var/www/html/{project-name}/storage
You need to run this command from the terminal.
php artisan config:clear
php artisan config:cache
I got the same issue, I change the permissions of the folders inside the the storage folder.
chmod 777 <folder_name>
I'm not sure about this security wise. but this resolve my problem.
I change my file settings to 755 also work for me.
try this
remove your "vendor" folder
Run "composer install" or "composer install --ignore-platform-reqs" on your cmd or terminal
php artisan config:cache
php artisan config:clear
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache
if you are using linux:
service apache2 restart (just in case)
if you using xammp:
just restart your xammp
For those of you using sail, do:
sail artisan optimize:clear

Php artisan optimize is failing on production server

Running composer install on a production server via a bash script is failing at post-install-cmd php artisan optimize with the error There are no commands defined in the "jwt" namespace.
To try to resolve the issue I added the following commands before php artisan optimize
"php artisan clear-compiled",
"php artisan cache:clear",
"php artisan config:clear",
"php artisan config:cache",
Running composer install locally works fine. I can run the commands through a script locally without a problem.
The failure is happening while running composer install through a script on the production server. If I log onto the server and run the commands manually I do not generate the error.
Not sure how to debug, any ideas?
Try adding a pre-install event inside of your composer.json file on the server, note that this event works only if your composer.lock is present and you ran composer install:
"scripts": {
"pre-install-cmd": [
"php artisan config:clear"
],
...
}

Resources