Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
540 views
in Technique[技术] by (71.8m points)

php - How can I setup an Laravel project on IIS 7.5?

I have a php application that I write using Laravel framework. I developed it using XAMPP server which was running fine.

I want to move it to a production server where I can use IIS 7.5 to manage my applications.

Here is what I have done

  1. I installed IIS
  2. I installed PHP Manager

Created a folder called laravel in C:inetpubwwwroot 2. Using PHP Manager I changed the PHP version to 5.6.18 3. In my php.ini of the version 5.6.18 I enabled the following lines

extension_dir = "ext"
cgi.force_redirect = 0
cgi.fix_pathinfo = 1
fastcgi.impersonate = 1
fastcgi.logging = 0
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
date.timezone = "ENTER YOUR TIMEZONE HERE"
session.entropy_length = 32
  1. I installed composer with php 5.6.18
  2. I imported the .httaccess file located in the public folder using URL Rewrite Model in IIS. This step created a web.config file. Then I moved it to the public folder.
  3. I converted my Laravel to Application in IIS
  4. I added phpinfo.php file in the root of my laravel all and I was able to see it via the browser.

But I can't access my laravel app.

When I go to http://localhost/laravel/public/index.php I get an error

HTTP 500 Internal error

I followed the blogs below to get where I am at now

http://alvarotrigo.com/blog/installing-laravel-4-in-windows-7-with-iis7/

https://laracasts.com/discuss/channels/general-discussion/iis7-laravel-5?page=2

How can I get laravel app to run?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I finally figure it out.

Everything I have done was correct except of 2 things

  1. I changed the Physical Path on the application to point to the public folder instead of the root.
  2. I IIS User need to have full control permission on the bootstrap/cache and storage << this is very critical step to get everything to work

Everything is running fine now.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...