Laravel on IIS

START WITH:
php and getcomposer

composer global require "laravel/installer"

c:
cd \Websites\Development\2018

laravel new project-website-name

cd project-website-name

php artisan serve (ctrl-C to exit)

– OR –

iisadmin
add C:\Websites\Development\2018\project-website-name\public
run with php 7.(1.12?)
CHANGE rights WITH Properties-Security-EDIT-Users-MODIFY
ON /storage AND /bootstrap/cache

CHECK SERVER REQUIREMENTS
PHP >= 7.0.0
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension

Check php.ini
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll

AND ADD TO /public/web.config
<rewrite>
<rules>
<rule name=”Rule 1″ stopProcessing=”true”>
<match url=”^(.*)/$” ignoreCase=”false” />
<action type=”Redirect” redirectType=”Permanent” url=”/{R:1}” />
</rule>
<rule name=”Rule 2″ stopProcessing=”true”>
<match url=”^” ignoreCase=”false” />
<conditions>
<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>

NEXT you create a database and add some basic tables with

php artisan migrate
and you might run into the next problem…

Laravel 5.4: Specified key was too long error

Laravel 5.4 made a change to the default database character set, and it’s now utf8mb4 which includes support for storing emojis. This only affects new applications and as long as you are running MySQL v5.7.7 and higher you do not need to do anything.

For those running MariaDB or older versions of MySQL you may hit this error when trying to run migrations:

[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))

[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

As outlined in the Migrations guide to fix this all you have to do is edit your AppServiceProvider.php file and inside the boot method set a default string length:

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}

After that everything should work as normal.


OR:

this also can solve it:

in config/databa se.php in mysql section

       'charset' => 'utf8mb4',
       'collation' => 'utf8mb4_unicode_ci',

replace with

       'charset' => 'utf8',
       'collation' => 'utf8_unicode_ci',

https://gist.github.com/deselbi/75e35c472351ada436c4077e0a03e7f2

this will allow user email to be longer then 191 characters log but will not support some charactes:

http://stackoverflow.com/questions/30074492/what-is-the-difference-between-utf8mb4-and-utf8-charsets-in-mysql