I googled the matter and there are many who've had this issue, but each had his own very unique case, and at the end nothing I read helped me.
I just finished installing Laravel with xampp, hopefully properly. Apache and MySQL are running.
I'm starting with the very first tutorial:
http://laravel.com/docs/4.2/quick#routing
My app root is:
http://localhost/Laravel/tests/app/
The hello.php file is working for me, I even tested some php code (plain not laravel) and it worked:
http://localhost/Laravel/tests/app/views/hello.php
As the tutorial instructed, I added in app/routes.php:
Route::get('users', function()
{
return 'Users!';
});
but when I try to access
http://localhost/Laravel/tests/app/views/users
I get "Object not found!" while I should be getting the text "Users!"
This is not route correct, test with: http://localhot/Laravel/tests/public/users
Related
I've been laraveling for 5 months now but I reformatted ubuntu and installed Laravel, this time, it's Laravel 7 instead of Laravel 6. My problem is simple routing giving an error. It's so dead simple you might think I'm a stupid beginner.
In my Web.php
Route::get('/about', function () {
return view('welcome');
});
Route::get('/', function () {
return view('welcome');
});
I also tried using a controller that returns a view and just a simple "string" in Web.php
Route::get('/about', 'UserController#index');
Typing http://localhost/about in the address bar in chrome causes 404 error.
As you can see, there should be no problem returning the same view('welcome'), even if I return a simple return "TEST";, results are the same.
I tried downgrading to Laravel 6 by deleting vendor, changing the Laravel v6 in composer.json and running composer install but still the same, so I think it's not the version.
This has never happened to me before even when I first started with Laravel 6 five months ago and it's a totally fresh project.
enable rewrite_mode of Apache server and restart Apache server it will solve the issue.
Run server with php artisan serve
and then try http://localhost:8000/about hope it will fix your problem
OR
Simply use http://localhost/project/about
I am getting an error like this:
Array to string conversion
Inside:
/var/.../vendor/cartalyst/sentry/src/Cartalyst/Sentry/SentryServiceProvider.php
Code snippet where the error was thrown:
throw new \InvalidArgumentException("Invalid hasher [$hasher] chosen for Sentry.");
I was doing ordianry work in one of my controllers and this error occured when I clicked on one of the buttons inside my blade.
I have commented the code out but the error still is being displayed, not only on this one page but on every single one in my project. I can't even go to my /home/index.php page.
I have done
composer update
inside my project but that did not help. What can fix the problem?
#update
Yes I have checked sentry config file before I've made a new topic. I have the same problem when I load older versions (which do not contain the latest changes I've made today) of my project on to apache server which is running on Ubuntu 14.04.
Ideas what causes the problem?
In the config for Sentry you have to define a hasher.
It has to be a string. It can be 'native', 'bcrypt', 'sha256' or 'whirlpool'. Apparently in your app, it's not a string, but an array. Check your configuration. It's probably in app/config/packages/cartalyst/sentry/config.php
I've picked up a project that was developed using Laravel 4.2. I've deployed it to my testing server (a Bitnami LAMP) and everything works as it's supposed to. HOWEVER, new routes that I create don't work, getting the error NotFoundHttpException.
I've gone through a few recommendations, but nothing has been successful thus far.
Any thoughts or ideas??
Thanks!
--
Just to clarify, any NEW route throws the same Not Found error. Even the simplest one like:
Route::get('test', function(){
return "This is a test";
});
It seems like Laravel is only serving an old version of the Routes.php, is this even possible???
Resolved this by recreating the project using Laravel 5 instead.
I have build a REST server and trying to make my java application communicate to it.
But I keep getting a 404 error.
When I type in the url in my browser along with the function name like:
[url]/controller/functionname/1.json
it works fine, returning me the right data.
Without the function name:
[url]/controller/1.json
I get this error:
"action 1.json not defined in controller".
I've checked my .htaccess file and routes against a previous version I had build which was working just fine. I can't figure out what the problem might be. Any suggestions?
And oh, I should mention, the earlier version that I talked about was build on windows and this one on ubuntu.
Can anyone explain if there is a way to catch or log errors when the following code is executed?
//This has example has no semicolon.
Route::get('user/{id}', function($id)
{
return View::make('profile')
});
or
//This example has no dollar sign (part of a blade template).
Welcome {{ userName }}
I end up with an empty page for these and there have been a few other times this has happened where I can't remember the details.
I have debug set to true in app/config/app.php and I don't get any errors in the log files at app/storage/logs
Is this normal or do I have a problem with my setup?
Thanks
UPDATE
Laravel log commands aren't working for me. See the comment in reply to msturdy.
Sorted this now. I downloaded the latest Laravel and still had identical issues. Eventually I found out that Apache was pointing at a old version of php (5.3.0) that lived on a different drive (no idea how I've done that), anyway I had my command line pointed at the correct version of php, so that's why I've had no issues when installing/updating Laravel.
Small chance anyone would see similar issues as it was a bit of a random situation (my apologies). I now get the prettiest runtime exception page I've ever seen when running the examples :). Thanks msturdy