วันพฤหัสบดีที่ 24 พฤษภาคม พ.ศ. 2555

Install PHP 5.4 on Windows Server 2008 R2 or Windows 7

1. Download PHP Thread safe on Non Thread safe it depend on your requirement.

2. Unpackage to folder you like (ex. is C:\php-5.4.3-Win32)

3. Open IIS (After you prepare IIS)
4. Go to Handler Mappings

5. Add Module Mapping
6. Add Input Like this one
    *Windows 7  If you cannot find FastCgi module see here.
7. On Request Restrictions Set to File only then click OK.
8. Now time to set php.ini  first make php.ini from copy from php.ini.production (or rename it if you don't want any backup) and set by this (this come from this reference)
extension_dir = "C:\php-5.4.3-Win32\ext" (what your directory you set that.)
if has comment in front ";" just delete it like
to
log_errors = On
error_log = "C:\php-5.4.3-Win32\temp\php_error.log" (Create folder temp in php folder or whatever you want to keep log file but beware on write or modifiled permission in windows)
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.logging = 0

php 5.4 recommend to set timezone before use.

date.timezone = "Asia/Bangkok"

for timezone see list here
for more details see http://php.net/date.timezone

extension_dir = "C:\php-5.4.3-Win32\ext\"

for support Ms SQL Server see
http://pakorosprogramming.blogspot.com/2012/09/php-52-53-54-connected-mssql-with-sqlsrv.html

9. Now time to test for this just create php file in root folder or somewhere and open it for my sample i create phpinfo.php in root folder with code


if you have problem to create file php from text file may be set security to show up extension by this

10. Final result.
If it don't show up try to restart IIS first.

ไม่มีความคิดเห็น: