Category Archives: IIS

FTP in IIS 10

Notes:

  1. 如果要設定虛擬目錄,從FTP根目錄指到別的資料夾,虛擬目錄的名稱要和實際資料夾的名稱一模一樣
  2. 所有目錄都要設定權限給FTP user

fopen filename can not be empty error (or not readable exception)

When uploading a file with Voyager, following errors happen:

 

Solution:

Add IUSR to the folder which “upload_tmp_dir” points to. Normally “C:\Windows\Temp” in windows.

Reference:

Notes to install PHP 7.2 and Laravel on windows server 2008 (SQL Server)

https://laravel-news.com/subfolder-install

cd inetpub/laravel

comment “;extension=php_mysql.dll” in php.ini

Install url-rewrite module for IIS

https://www.iis.net/downloads/microsoft/url-rewrite

Import rewrite rules:

  • https://stackoverflow.com/questions/15018538/laravel-htaccess-rewrite-rule-conversion-to-iis

install failed request tracing (Optional)

  • https://serverfault.com/questions/309135/dont-see-failed-request-tracing-in-iis-7-manager
  • https://docs.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis

Change laravel structure:

Change path in public/index.php
require __DIR__.’/../../../../laravel/vendor/autoload.php’;
$app = require_once __DIR__.’/../../../../laravel/bootstrap/app.php’;

Add mofify permission for user “IUSR” to “D:\Inetpub\laravel\storage\framework\sessions”

Install Visual C++ 2017

https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads

SQL Server related:

Add this line in php.ini:

extension=php_pdo_sqlsrv_72_ts_x64.dll

Change database configs in .env:

  • Change DB port to 1433

Upload Related Issue

If upload fails all the time (file not found exception), try create a folder for PHP to upload temp files. e.g. C:\phptmp

Revise php.ini as well: