{"id":5182,"date":"2013-12-09T01:00:00","date_gmt":"2013-12-09T00:00:00","guid":{"rendered":"https:\/\/alvarotrigo.com\/epa\/installing-laravel-4-in-windows-7-with-iis7\/"},"modified":"2024-02-05T20:10:22","modified_gmt":"2024-02-05T19:10:22","slug":"installing-laravel-4-in-windows-7-with-iis7","status":"publish","type":"post","link":"https:\/\/alvarotrigo.com\/blog\/installing-laravel-4-in-windows-7-with-iis7\/","title":{"rendered":"Installing Laravel 4 in Windows 7 with IIS7"},"content":{"rendered":"\n<p>There are always some boring steps until we can actually start using a framework.<br>\nMoreover working with <strong>Windows<\/strong> and <strong>IIS<\/strong> makes things more difficult\/tedious yet. I always find myself having to google these kind of things and this time I decided to keep a record of the steps I followed. This way I won&#8217;t have to face the same problems in future installations in other machines. Also, hopefully this can help someone else in the same situation!<\/p>\n\n\n\n<p><img decoding=\"async\" class=\"post-picture lazy\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP89B8AAukB8\/71MdcAAAAASUVORK5CYII=\" data-src=\"https:\/\/alvarotrigo.com\/blog\/wp-content\/uploads\/2013\/12\/Installing-Laravel-4-in-Windows-7-with-IIS7.jpg\" alt=\"Installing-Laravel-4-in-Windows-7-with-IIS7\" width=\"626\" height=\"293\"><\/p>\n\n\n\n<p>These are the steps I followed to install Laravel 4 framework to work under my Windows 7 machine with IIS7:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n\n\n<p>Download the last version of <a href=\"http:\/\/windows.php.net\/download\/\" target=\"_blank\" rel=\"noopener nofollow\">PHP Non Thread Safe for windows<\/a>.<\/p>\n<\/li>\n\n\n\n<li>\n\n\n<p>Place the <code>php<\/code> folder inside <code>C:\/<\/code><\/p>\n<\/li>\n\n\n\n<li>\n\n\n<p>Rename <code>php.ini-development<\/code> (or <code>php.production<\/code> if you are on production) to <code>php.ini<\/code><\/p>\n<\/li>\n\n\n\n<li>\n\n\n\n<p>Open <code>php.ini<\/code> and:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>set <code>fastcgi.impersonate = 1<\/code><\/li>\n\n\n\n<li>set <code>cgi.fix_pathinfo=1<\/code><\/li>\n\n\n\n<li>set <code>cgi.force_redirect = 0<\/code><\/li>\n\n\n\n<li>Uncomment <code>extension_dir = \"ext\"<\/code><\/li>\n\n\n\n<li>Enable openssl in <code>php.ini<\/code> by uncommenting: <code>extension=php_openssl.dll<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\n\n\n<p>Install the package <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=30679\" target=\"_blank\" rel=\"noopener nofollow\">Visual C++ Redistributable for Visual Studio 2012<\/a> (version x86: vcredist_x86.exe)<\/p>\n<\/li>\n<\/ul>\n\n\n\n<p><img decoding=\"async\" class=\"post-picture lazy\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP89B8AAukB8\/71MdcAAAAASUVORK5CYII=\" data-src=\"https:\/\/alvarotrigo.com\/blog\/wp-content\/uploads\/2013\/12\/visual-studio.jpg\" alt=\"visual-studio\" width=\"500\" height=\"226\"><\/p>\n\n\n<p>&#8211; Download Laravel [from github](https:\/\/github.com\/laravel\/laravel\/archive\/master.zip) and extract it into the `wwwroot` folder.<br \/>\n&#8211; [Download](https:\/\/getcomposer.org\/Composer-Setup.exe) and install composer for windows in the same directory as `php.exe` is located:<\/p>\n\n\n<p><img decoding=\"async\" class=\"post-picture lazy\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP89B8AAukB8\/71MdcAAAAASUVORK5CYII=\" data-src=\"https:\/\/alvarotrigo.com\/blog\/wp-content\/uploads\/2013\/12\/composer-install.jpg\" alt=\"composer-install\" width=\"510\" height=\"396\"><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the console, move to laravel folder and type the command:<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">composer install\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><img decoding=\"async\" class=\"post-picture lazy\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP89B8AAukB8\/71MdcAAAAASUVORK5CYII=\" data-src=\"https:\/\/alvarotrigo.com\/blog\/wp-content\/uploads\/2013\/12\/laravel4-install-windows.jpg\" alt=\"laravel4-install-windows\" width=\"677\" height=\"545\"><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add permissions for the ISS user for the <code>storage<\/code> folder:<\/li>\n<\/ul>\n\n\n\n<p><img decoding=\"async\" data-src=\"https:\/\/alvarotrigo.com\/blog\/wp-content\/uploads\/2013\/12\/permissions.jpg\" alt=\"permissions\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 374px; --smush-placeholder-aspect-ratio: 374\/486;\"><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Make sure you have installed &#8220;URL Rewrite 2.0&#8221; for IIS 7, if not, <a href=\"http:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite\" target=\"_blank\" rel=\"noopener nofollow\">download it<\/a>.<\/li>\n\n\n\n<li>Import .htaccess rules located in the &#8220;public&#8221; folder of laravel into the URL Rewrite module of IIS 7:<\/li>\n<\/ul>\n\n\n\n<p><img decoding=\"async\" class=\"post-picture lazy\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP89B8AAukB8\/71MdcAAAAASUVORK5CYII=\" data-src=\"https:\/\/alvarotrigo.com\/blog\/wp-content\/uploads\/2013\/12\/iis7-rewrite-web-config-laravel.jpg\" alt=\"iis7-rewrite-web-config-laravel\" width=\"100%\" height=\"auto\"><\/p>\n\n\n\n<p>Once applied this will generate a file called web.config inside your laravel main folder.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Move the created <code>web.config<\/code> file into the <code>public<\/code> folder.<\/li>\n<\/ul>\n\n\n\n<p>This is the web.config file which was generated in my case:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-meta\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">configuration<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">system.webServer<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">rewrite<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">rules<\/span>&gt;<\/span>\n                <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">rule<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"Imported Rule 1\"<\/span> <span class=\"hljs-attr\">stopProcessing<\/span>=<span class=\"hljs-string\">\"true\"<\/span>&gt;<\/span>\n                    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">match<\/span> <span class=\"hljs-attr\">url<\/span>=<span class=\"hljs-string\">\"^\"<\/span> <span class=\"hljs-attr\">ignoreCase<\/span>=<span class=\"hljs-string\">\"false\"<\/span> \/&gt;<\/span>\n                    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">conditions<\/span> <span class=\"hljs-attr\">logicalGrouping<\/span>=<span class=\"hljs-string\">\"MatchAll\"<\/span>&gt;<\/span>\n                        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">add<\/span> <span class=\"hljs-attr\">input<\/span>=<span class=\"hljs-string\">\"{REQUEST_FILENAME}\"<\/span> <span class=\"hljs-attr\">matchType<\/span>=<span class=\"hljs-string\">\"IsDirectory\"<\/span> <span class=\"hljs-attr\">ignoreCase<\/span>=<span class=\"hljs-string\">\"false\"<\/span> <span class=\"hljs-attr\">negate<\/span>=<span class=\"hljs-string\">\"true\"<\/span> \/&gt;<\/span>\n                        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">add<\/span> <span class=\"hljs-attr\">input<\/span>=<span class=\"hljs-string\">\"{REQUEST_FILENAME}\"<\/span> <span class=\"hljs-attr\">matchType<\/span>=<span class=\"hljs-string\">\"IsFile\"<\/span> <span class=\"hljs-attr\">ignoreCase<\/span>=<span class=\"hljs-string\">\"false\"<\/span> <span class=\"hljs-attr\">negate<\/span>=<span class=\"hljs-string\">\"true\"<\/span> \/&gt;<\/span>\n                    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">conditions<\/span>&gt;<\/span>\n                    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">action<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"Rewrite\"<\/span> <span class=\"hljs-attr\">url<\/span>=<span class=\"hljs-string\">\"index.php\"<\/span> \/&gt;<\/span>\n                <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">rule<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">rules<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">rewrite<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">system.webServer<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">configuration<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>So that&#8217;s it!<br>\nAfter this I was able to start playing with <strong>Laravel4<\/strong> in my <strong>windows<\/strong> environment. I hope this can be of help for somebody else.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"references\">References<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/laravel.com\/docs\/installation#install-laravel\" target=\"_blank\" rel=\"noopener nofollow\">http:\/\/laravel.com\/docs\/installation#install-laravel<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dd239230(v=ws.10).aspx\" target=\"_blank\" rel=\"noopener nofollow\">http:\/\/technet.microsoft.com\/en-us\/library\/dd239230(v=ws.10).aspx<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.wikihow.com\/Install-Laravel-Framework-in-Windows\" target=\"_blank\" rel=\"noopener nofollow\">http:\/\/www.wikihow.com\/Install-Laravel-Framework-in-Windows<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.howtogeek.com\/50432\/how-to-install-php-on-iis-7-for-windows-server-2008\/\" target=\"_blank\" rel=\"noopener nofollow\">http:\/\/www.howtogeek.com\/50432\/how-to-install-php-on-iis-7-for-windows-server-2008\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>There are always some boring steps until we can actually start using a framework. Moreover working with Windows and IIS makes things more difficult\/tedious yet. I always find myself having to google these kind of things and this time I decided to keep a record of the steps I followed. This way I won\u2019t have to face the same problems in future installations in other machines. Also, hopefully this can help someone else in the same situation!<\/p>\n","protected":false},"author":1,"featured_media":5181,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[105],"tags":[45,44,62],"class_list":["post-5182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-developing","tag-backend","tag-php","tag-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/comments?post=5182"}],"version-history":[{"count":3,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5182\/revisions"}],"predecessor-version":[{"id":9597,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5182\/revisions\/9597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/media\/5181"}],"wp:attachment":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/media?parent=5182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/categories?post=5182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/tags?post=5182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}