Architecture Overview
Application Server
- Windows Server 2019
- IIS Role
- PHP 8.0
- phpMyFAQ
- Windows Server 2019
- SQL Server 2019
- Microsoft Web Platform Installer - https://www.microsoft.com/web/downloads/platform.aspx
- Microsoft ODBC 18 Driver - https://docs.microsoft.com/en-us/sql/co ... rver-ver16
- Microsoft sqlsrv extension - https://docs.microsoft.com/en-us/sql/co ... rver-ver16
- Microsoft VC Runtime 2019 - https://aka.ms/vs/16/release/vc_redist.x64.exe
- PHP 8.0
- PHP Manager (Optional, recommended) - https://github.com/phpmanager/phpmanager/releases
- SQL Server Management Studio (Optional) - https://docs.microsoft.com/en-us/sql/ss ... rver-ver16
Note:During setup of IIS, ensure you select CGI from under application development.
Web Platform Installer
If you haven't already installed the Web Platform Installer (WPI)
- Open IIS and select Get New Web Platform Components.
- Select Install this extension to download the installer
- Run the installer.
Microsoft Visual C++ Runtime 2019
Install the VC Runtime prior to attempting to install anything from WPI.
PHP 8.0
The easiest way to install PHP on IIS is through the use of WPI. WPI will automatically configure some settings in IIS to get php working.
- Open WPI
- In the top right corner search bar, enter PHP 8.0 and hit enter.
- Locate PHP 8.0 (x64) and select Add
- Select Install.
PHP Manager (Optional)
PHP Manager integrates with IIS to perform some basic, but critical functions for PHP. I highly recommend using it.
- Download the latest release of PHP Manager.
- After installing PHP Manager, open IIS.
- Select the server in the connections pane.
- In the main pane, select PHP Manager.
Enabling Required Extensions
PHP comes with most extensions required enabled by default. However, there are a couple required extensions that are not enabled by default.
- Open IIS
- Select the website that will host your files
- Open PHP Manager
- At the bottom, select Enable or disabl an extension
- Right-click php_fileinfo.dll and select Enable.
- Do the same for php_gd.dll.
- If you plan to integrate with directory services (Active Directory, OpenLDAP, etc...), you'll also need to enable php_ldap.dll.
Let's ensure PHP is working properly with IIS up to this point.
- Navigate to C:\inetpub\wwwroot
- Create a file called phpinfo.php.
- Edit the file using notepad and enter the following:
Code: Select all
<?php phpinfo(); ?>
- Save the file.
- Open a browser on the server.
- Go to localhost/phpinfo.php.
Microsoft ODBC Connector
If you haven't already, install the Microsoft ODBC driver linked in the Required Software section above.
Microsoft SQL Configuration
I recommend installing SQL Server Management Studio SSMS to setup a user and an empty database for phpMyFAQ.
- Log into SSMS
- Right-click on Security, highlight New, then Login...
- Enter a login name
- Select SQL Server authentication and enter a password.
- I would recommend disabling the three boxes related to password management for the user.
- Click OK to complete user setup.
- Right-click on Databases and select New Database...
- Enter phpmyfaq for the name.
- Click the three dots next to the Owner box and enter the username you just created.
- Click the Check Names box to ensure the user is properly detected and then click OK
- Click OK to complete database setup.
- Right-click on the server name in the connections pane and select Properties
- Select Connections on the left side and verify the box is checked to allow remote connections to the server.
Installation
- Delete any files in C:\inetpub\wwwroot.
- Unzip phpMyFAQ to C:\inetpub\wwwroot so that index.php is in the wwwroot folder.
- In File Explorer, goto C:\Inetpub
- Right-Click the wwwroot folder and select Properties
- On the Security tab, select Edit
- Select Users and then check the box under the Allow column for Full Control.
- Click Ok to apply the new permissions then OK to close the properties dialog.
phpMyFAQ 3.1.4: If you are testing in a non-production environment, you must edit the sqlsrv.php file to allow self-signed certificates from SQL.
- Open File Explorer and go to phpMyFAQ/src/phpMyFAQ/Database
- Open Sqlsrv.php using notepad
- Go to line 101, which should read 'CharacterSet' => 'UTF-8',
- Hit enter and then enter 'TrustServerCertificate' => true
Server: MS SQL Server
Host/Socket: IP Address of your SQL server
Port: 1433
User: Name of the user you created in SSMS
Password: Password of the user you created in SSMS
Database: Name of the database you created in SSMS
LDAP Setup
Host: IP Address of your LDAP server.
Port: LDAP port to use
User DN: Username in the syntax: DOMAIN\Username
Password: Domain user password
Base DN: Base OU to search for users.
Elasticsearch Setup
Server(s): IP Address:Port of your Elasticsearch Instance
Index Name: Desired name of your index. phpMyFAQ will create it for you.
Admin User Setup
These settings should be self-explanatory. Once complete, select Click to install phpMyFAQ 3.1.4 at the bottom to kick off creation of the database tables and basic setup.
With any luck, you'll get a page that tells you setup was a success with a link that will take you to your new homepage.
3.1.4 Specific Configuration Modifications
There are a couple database queries that need to be modified to properly work with MS SQL. Later versions should have these issues resolved.
Category Query
- Open File Explorer
- Navigate to phpmyfaq\src\phpMyFAQ
- Copy Category.php
- Rename the copy to Category.php.bak
- Open Category.php
- Go to line 255
- Change it to:
Code: Select all
fc.name, fc.id ASC',
- Save the file.
FAQ Query
- Open File Explorer
- Navigate to phpmyfaq\src\phpMyFAQ
- Copy faq.php
- Rename the copy to faq.php.bak
- Open faq.php
- Go to line 2393
- Change it to:
Code: Select all
fd.id,fd.lang,fcr.category_id,fv.visits,thema
- Save the file.
- Open File Explorer
- Navigate to phpmyfaq\src\phpMyFAQ\Attachment
- Copy AttachmentCollection.php
- Rename the copy to AttachmentCollection.php.bak
- Open AttachmentCollection.php
- Go to line 73
- Change it to:
Code: Select all
fa.id,fd.thema,record_id,record_lang,filename,filesize,mime_type',
- Save the file.