Install Laravel Site on Windows Server

Asked

Viewed 674 times

4

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

I put the site in a folder called 'new site'. And when I run the site like this:

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

But now there is not appearing an error that was before. It said that you were not allowed to open the Storage folder and an Laravel log file.

PHP Fatal error: Uncaught Exception 'Unexpectedvalueexception' with message 'The stream or file "E: home jslhidraulica New siteStorage/logs/Laravel.log" could not be opened: failed to open stream: Permission denied' in E:home jslhidraulica Web sitenew vendor monolog monolog src Monolog Handler Streamhandler.php:97

But all folders are with CHMOD 777. I have checked.

All Laravel 5.2 versions are enabled in Windows PHP. I am using PHP version 5.5.13.

And all requested modules are enabled.

I believe it has to do with some configuration that has in .htaccess. But that I know Windows does not read . htaccess and yes web.config.

But I don’t know how to set up a user-friendly URL on the web.config.

  • Laravel 5.2 only runs in php >= 5.5.9 https://laravel.com/docs/5.2#server-Requirements

  • 5.5.9, is not that ?

  • Opps, of course sorry for the lapse

  • But you see... I’m searching on the Net. Uploaded the site now, but no images with nothing...

  • Check the console for why? Could be a 403 error, probably permissions

  • Nothing appeared on the console.

  • Really? What if you have element inspected on top of an image that is supposed to appear? Does cumin appear for it? You can also see this if instead of going to the console and refreshing the page, you see all the requests and answers made

  • This appears in the Console. Resource Interpreted as Stylesheet but transferred with MIME type text/html:

  • But now that I’ve seen it. It doesn’t load the new site that I did, it loads the current all wrong without CSS. It’s my Webconfig that’s wrong. I don’t know how to handle it

  • My dear, in that case my skills stick around here lol. I don’t know how to help you from here

Show 5 more comments

1 answer

4


To host Laravel in Windows you must configure the file web.config in accordance with .htaccess for Linux Server.

For this you can use a conversion tool .htaccess for web.config that the IIS (Internet Information Service).

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

Step by Step - IIS Remote Manager Locaweb

Download IIS Remote Manager

Inside there is an easy-to-use conversion module. Paste the code from the .htaccess that Laravel generates inside the folder public in the top block and click on the button to convert.

But to facilitate all this I will put below the code of .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>
  • Thank you for answering. You helped me a lot! You saved me!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.