InvalidArgumentException Please provide a valid cache path - php

As this question has been asked soo many time and the solution is clear, but my problem is I have done every possible solution but it still doesn't solve my error.
I have all the required folders
-storage
-app
-framework
-cache
-session
-testing
-views
-logs
and also all the ".gitignore" files as well
also have run permission command
Below is my config/view.php
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('/storage/framework/views'))
),
];

Related

Facing 404, The route could not be found. Laravel Livewire

I am Facing 404, The route public/livewire/message/software-category could not be found.
I am using Laravel 9 with livewire and my components are loaded perfectly but when I try to update any attribute value of the component, it returns 404 not found.
here is my .env
APP_URL=https://fyp.devndesigns.com/
ASSET_URL=https://fyp.devndesigns.com/public
here is my config/livewire.php in which I changed my asset_url but it is not working.
<?php
return [
/*
|--------------------------------------------------------------------------
| Livewire Assets URL
|--------------------------------------------------------------------------
|
| This value sets the path to Livewire JavaScript assets, for cases where
| your app's domain root is not the correct path. By default, Livewire
| will load its JavaScript assets from the app's "relative root".
|
| Examples: "/assets", "myurl.com/app".
|
*/
'asset_url' => env('ASSET_URL'),
/*
|--------------------------------------------------------------------------
| Livewire App URL
|--------------------------------------------------------------------------
|
| This value should be used if livewire assets are served from CDN.
| Livewire will communicate with an app through this url.
|
| Examples: "https://my-app.com", "myurl.com/app".
|
*/
'app_url' => null,
Change .env to :
APP_URL=https://fyp.devndesigns.com
ASSET_URL=https://fyp.devndesigns.com
and config/livewire.php
'asset_url' => env('ASSET_URL', null),
'app_url' => env('APP_URL', 'http://localhost'),

Laravel File Storage Location

I am running my Laravel Project on centos, using the default artisan server.
I am trying to add data to files, using laravel File::append command.
In config/filesystems.php i have the following:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('data'),
],
and
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
and 'FILESYSTEM_DRIVER' is not defined in the .env file.
However when i use File::append(), the files are created in the public folder, and not storage_path
Any idea what is causing this?What am i missing.
While Storage::put('filename.jpg', $contents); uses the default filesystem and thus expects a relative filename, File::append does not.
So a possible solution here could be File::append($path, 'yourAppend'); with the full path to your file in the storage folder.

Laravel project deployment gives the HTTP ERROR 500

Before you assume, I did read ALL other posts on this problem and I was unable to find a solution to my problem.
So the thing is, however and wherever i upload my files and folders on my web host i get the same result giving me the "currently unable to handle this request. HTTP ERROR 500". I'm using the 000webhostapp.
So I uploaded the project in my root directory "/", content of the public to the public_html project, and it gave me the text above. Then I tried moving my whole project into the public_html(public was its own directory inside public_html) and it gave me the same result. I've tried some solutions with .htaccess file but whatever I tried won't make it work. In my localhost project is installed somewhat like this "htdocs/kola/..", but on the web hosting it is just in the root, no other dir(that's something I think might help but I'm unable to use). So after 30 hours of trying and reuploading the project 5 times, still can't make it work and I'd be rather grateful if someone could even try to help me with this.
Thanks in advance
The right way is to get to the root of your folder ... ie /home/ and create a folder for your project. Then move the all the contents of your project into this folder except the public folder. Now go to the public_html folder and add all the contents of the public folder there.
Update your index.php as below:
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* #package Laravel
* #author Taylor Otwell <taylor#laravel.com>
*/
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels great to relax.
|
*/
require __DIR__.'/../(name of your root folder)/bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../(name of your root folder)/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
Configure the .env file and have the right database configuration.
Need not to create new dir. Just delete the content of index.php file and paste the above code and replace your (name of your root folder) with public_html.

Routes not working after Laravel 5.3 upgrade

I'm trying upgrade my laravel project from 5.2 to 5.3.
Since laravel 5.3, the route files are kept in a separate directory routes, instead of the previous app\Http directory. I created the file routes/web.app and pasted my routes into this file.
When i execute php artisan route:list, it returns:
+--------+----------+-------------------+------+--------------------------------------------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+-------------------+------+--------------------------------------------+------------+
| | GET|HEAD | captcha/{config?} | | \Mews\Captcha\CaptchaController#getCaptcha | web |
+--------+----------+-------------------+------+--------------------------------------------+------------+
My routes/web.php file:
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function(){
echo 'here';
});
Where is my route?
When I access the home page, it returns a 404 error, but the error comes from laravel.
The file .htaccess is ok.
You said:
I created the file routes/web.app and past my routes on file.
In Laravel 5.3 the web.php file is already created in the routes directory. If you have recreated this file that is where the problem may be propagating from.
I read the upgrade documentation and thought I needed to remove the EventServiceProvider, RouteServiceProvider, AuthServiceProvider methods from the boot ....
But in fact I needed to update the contents of these files.
After updating the contents to the new version 5.3 up to where I tested, it is working ....

CodeIgniter cache - system or application

Confused.
https://www.codeigniter.com/user_guide/general/caching.html
says caches are created in application/cache.
But, in the system config.php it says the default cache is in system/cache/.
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder. Use a full server path with trailing slash.
|
*/
Which, if any, does CI use?
application/cache is correct. It was changed to application/cache from system/cache in 2.0.0 according to the change log. The comments just weren't updated.

Categories