1

I have a route that is working, but for a specific route, it is not working.

Route::get("/index", function () {
    return view('index');
});
Route::get("/dynamicrequest1", function () {
    return view('dynamicrequest1');
});

the index route is working, while the dynamicrequest1 is not, and by not working, it gives me like this: enter image description here

while if i request any other none exsitence page, like bla bla bla, i get this error

enter image description here

I have a dynamicrequest1.blade.php that contains this simple html

<!DOCTYPE html>
<html>
<head>
<title>Welcome</title>
<link rel="stylesheet" type="text/css" href="{{URL::asset('assets/css/bootstrap.min.css')}}">
<script type="text/javascript" src="assets/js/jquery-2.2.1.min.js"></script>
<script type="text/javascript" src="{{URL::asset('assets/js/bootstrap.min.js')}}"></script>
<script type="text/javascript" src="{{URL::asset('assets/js/index.js')}}"></script>
<link rel="stylesheet" type="text/css" href="{{URL::asset('assets/css/index.css')}}">
</head>
<body>
    <div class="container">
    <form method="post" action="./request/send">
        <textarea id="code" contentEditable="true" name="body"></textarea>
        <input type="text" value="http://68.168.100.142:9200/propertywebsites3/_search?size=1" name="endPoint" id="endPoint"/>
        <input type="button" id="formattCode" value="format"/>
        <input type="submit" value="send"/>
    </form>
</div>
</body>
</html>

Update 1

I am running my project on xampp because when i run it using

php artisan serve

all the requests return the same error as the dynamicrequest1 does

Update 2

executing

php artisan route:list

giving me:

enter image description here

Anastasie Laurent
  • 1,169
  • 6
  • 23
  • 35
  • 500 is server error, there gotta be an error somewhere, possibly in your view, try to delete all html and put just one word as a test, and check your logs – Seva Kalashnikov Apr 04 '16 at 22:42
  • @sef4eg when I put just one word, I get the same error. – Anastasie Laurent Apr 04 '16 at 22:44
  • Off the top of my head, to troubleshoot: 1. Try clearing the route cache `artisan route:clear`, 2. In your view remove your URL facades (and possibly the endpoint input you've got there) so you can narrow it down – Sworrub Wehttam Apr 04 '16 at 22:44
  • Also, try this: http://stackoverflow.com/a/31561357/4018897 permissions always cause me errors... – Sworrub Wehttam Apr 04 '16 at 22:45
  • @SworrubWehttam the route clear doesn't change anyting, for your second point, I didn't get u, could you repeat in simple english please? – Anastasie Laurent Apr 04 '16 at 22:51
  • @SworrubWehttam in the ansewr you've mentioned, I need to execute a terminal command, on which director should I point my terminal to please ? – Anastasie Laurent Apr 04 '16 at 22:52
  • What do you get from `artisan route:list`. You need to execute the command from your laravel base directory (the one in which your public directory is) – Wistar Apr 04 '16 at 22:57
  • You also try to do `Route::get("/dynamicrequest1", function () { var_dump('Hello World!') });` Does that work? – Wistar Apr 04 '16 at 23:02
  • 1
    The fastest and easiest way to find out why you're getting a 500 error is to check the apache logs OR turn on DEBUG in your laravel install which should be in your .ENV , that should point you in the right direction. – odannyc Apr 04 '16 at 23:02
  • @Wistar I update my question to give you the route:list – Anastasie Laurent Apr 04 '16 at 23:03
  • @Wistar when I put the code your suggest, all pages *including the ones that were working** stop working, when i remove it and put my old route, just the dynamicrequest1 not work – Anastasie Laurent Apr 04 '16 at 23:07
  • @odannyc where can I find this .ENV file please ? – Anastasie Laurent Apr 04 '16 at 23:08
  • @AnastasieLaurent It is hard to tell what it could be from what you have. I would try what Odannyc suggested – Wistar Apr 04 '16 at 23:08
  • It could be a permission error See: http://stackoverflow.com/questions/31543175/getting-a-500-internal-server-error-on-laravel-5-ubuntu-14-04 – Wistar Apr 04 '16 at 23:10
  • @Wistar * It is hard to tell what it could be from what you have*, Okay tell me what do you want and I execute all the commands that you want and update you by the results – Anastasie Laurent Apr 04 '16 at 23:11
  • @Wistar if it is a permission error, why the other route (the index works)? – Anastasie Laurent Apr 04 '16 at 23:12
  • It goes back to your Apache logs. WIth xamp I believe they are located there \{Your_xamp_folder}\apache\logs\error.log by default. – Wistar Apr 04 '16 at 23:16
  • @AnastasieLaurent Okay so youre on XAMPP.. Windows or Mac? – odannyc Apr 04 '16 at 23:16
  • @odannyc on mac on xampp – Anastasie Laurent Apr 04 '16 at 23:20
  • @AnastasieLaurent Click on XAMPP manager > Manage Servers > Apache Web Server > Configure > Open Error Log .... – odannyc Apr 04 '16 at 23:21
  • okay it is working now, i wrote an answer, it is weird – Anastasie Laurent Apr 04 '16 at 23:21
  • @odannyc but though it is working, it is still giving me the old html, when i update the html, it doesn't update, is there a cahs i should delete please ? – Anastasie Laurent Apr 04 '16 at 23:23
  • @AnastasieLaurent It's always good to know why things happen and the best place to always look is the logs, so in the future if anything goes wrong look in the logs first and you'll save hours of troubleshooting. – odannyc Apr 04 '16 at 23:23
  • @odannyc there was nothing in the log, i look before and even now i look but it just says 500 error – Anastasie Laurent Apr 04 '16 at 23:26

2 Answers2

1

A 500 error is an error within your code. I suspect it's your URL::Asset php code. Try to replace thedynamicrequest1.blade.php page you have with the one below.

<!DOCTYPE html>
<html>
<head>
<title>Welcome</title>
<link rel="stylesheet" type="text/css" href="/assets/css/bootstrap.min.css">
<script type="text/javascript" src="/assets/js/jquery-2.2.1.min.js"></script>
<script type="text/javascript" src="/assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/index.js"></script>
<link rel="stylesheet" type="text/css" href="assets/css/index.css">
</head>
<body>
    <div class="container">
    <form method="post" action="./request/send">
        <textarea id="code" contentEditable="true" name="body"></textarea>
        <input type="text" value="http://68.168.100.142:9200/propertywebsites3/_search?size=1" name="endPoint" id="endPoint"/>
        <input type="button" id="formattCode" value="format"/>
        <input type="submit" value="send"/>
    </form>
</div>
</body>
</html>
odannyc
  • 717
  • 9
  • 25
0

It is working now. I was using Hotspot shield, it was on, when i turn it off, the app works again.

Wistar
  • 3,770
  • 4
  • 45
  • 70
Anastasie Laurent
  • 1,169
  • 6
  • 23
  • 35