Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vbounyar's avatar

Laravel and Azure

I was wondering if someone can help me. So currently I am hosting a Laravel 5.3 project on Azure. In order to get it working I have to make a web.config file and put it in the public folder. I used this web.config: https://gist.github.com/allebb/7d5d4af32491c11dafc4

However, I am finding that some of the routes that worked in my local dev (it is apache/WAMP) doesn't work at all in Azure. The following example will display "Hello world again" on my local dev and in Azure display error that says, "Missing argument 1 for App\Http\Controllers\HomeController::test()" if I go to http://www.somesite.com/test_reroute

My codes (simplified):

In my web.php:

Route::get("/test_reroute", function(){ $data = ["message" => "Hello world again."]; return redirect()->action('HomeController@test', $data); });

Route::get("/hello/{message}", "HomeController@test");

In my HomeController.php:

class HomeController extends Controller {

public function test($message) {
    return $message ? $message : "HELLO WORLD";
}

}

So anybody got ideas? I am thinking I will have to add something to the web.config file. Though I have no idea what that would be, lol.

0 likes
5 replies
vbounyar's avatar

Laravel shows up. Only if I go to that route that I get that error.

vbounyar's avatar

And I figured it out. It seems that I had to add this to the web.config (info here if anyone is concern of turning this off, http://stackoverflow.com/questions/1453218/is-enabling-double-escaping-dangerous. For my case, I am doing a search):

<system.webServer>
    <security>
        <requestFiltering allowDoubleEscaping="true"/>
    </security>
</system.webServer>

and restart the web app from Azure. Not entirely sure as I was just passing a string but maybe it was the spaces being encoding as "+"?

Thanks for the help though :D.

DavidB13213's avatar

@vbounyar Hi, I am trying to host the application in. But I am facing the issues. If you have any documentation could you please share it with me or please guide me. Thanks in advance,

Please or to participate in this conversation.