Install Laravel Site on Windows Server

4

I've never had this experience of putting a website on the air using Windows Server 2012 on Locaweb.

I placed the site in a folder called 'sitenovo'. And when I run the site, it does this:

  

HTTP Error 500.0 - Internal Server Error   C: \ PHP_5.5 \ php-cgi.exe - The FastCGI process exited unexpectedly

But now there is a bug that was before. It said it was not allowed to open the storage folder and a Laravel log file.

  

PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "E: \ home \ jslhidraulica \ Web \ sitenovo \ storage / logs / laravel.log" could not be opened: failed to open stream: Permission \ monolog \ monolog \ src \ Monolog \ Handler \ StreamHandler.php: 97

But all the folders are with CHMOD 777. I've already checked.

All Laravel 5.2 requirements are enabled in Windows PHP. I'm using PHP version 5.5.13.

And all requested modules are enabled.

I think it has to do with some configuration you have in .htaccess. But what I know Windows does not read .htaccess and yes web.config.

But I do not know how to configure friendly URL in web.config.

    
asked by anonymous 02.07.2016 / 16:50

1 answer

4

To host Laravel on Windows, you should set the web.config file to the same .htaccess for Linux Server.

For this you can use a conversion tool from .htaccess to web.config to Internet Information Service .

And then you have to install an add-on called IIS Remote Manager , which is a Site Manager under Windows Server, just like a cPanel.

Footsteps - IIS Remote Manager Locaweb

Download IIS Remote Manager

Inside you have an easy-to-use conversion module. Paste the .htaccess code that Laravel generates into the public folder in the top block and clicks the convert button.

But to make it easy, I'll put down the code from .htaccess converted to web.config .

<rewrite>
    <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
            <match url="^(.*)/$" ignoreCase="false" />
            <conditions>
                <!--# Redirect Trailing Slashes If Not A Folder...-->
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Redirect" redirectType="Permanent" url="/{R:1}" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
            <match url="^" ignoreCase="false" />
            <conditions>
                <!--# Handle Front Controller...-->
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php" />
        </rule>
    </rules>
</rewrite>
    
23.12.2016 / 13:48