Serveur Web
⚙️ Installation du rôle IIS et des modules nécessaires
Install-WindowsFeature -Name Web-Server -IncludeManagementTools
Install-WindowsFeature -Name Web-CGI -IncludeManagementTools🛠️ Installation et configuration de PHP
1
Invoke-WebRequest "https://windows.php.net/downloads/releases/php-8.4.3-nts-Win32-vs17-x64.zip" -OutFile ".\Downloads\php.zip"
Expand-Archive -Path ".\Downloads\php.zip" -DestinationPath "C:\php"2
Copy-Item "C:\php\php.ini-production" "C:\php\php.ini"3
notepad "C:\php\php.ini"extension_dir = "C:\php\ext"
cgi.force_redirect = 0
fastcgi.impersonate = 1
log_errors = On
error_log = "C:\php\logs\php_errors.log"extension=mysqli
extension=curl
extension=mbstring4
New-Item -ItemType Directory -Path "C:\php\logs"5
New-Item -ItemType Directory -Path "C:\Temp"
Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "C:\Temp\vc_redist.x64.exe"
Start-Process -FilePath "C:\Temp\vc_redist.x64.exe" -ArgumentList "/install /quiet /norestart" -Wait⚡ Configuration de PHP avec FastCGI dans IIS
1
Import-Module WebAdministration
Set-WebConfigurationProperty -pspath "MACHINE/WEBROOT/APPHOST" -filter "system.webServer/fastCgi" -name "." -value @(
@{
fullPath = "C:\php\php-cgi.exe";
arguments = "";
instanceMaxRequests = 10000;
environmentVariables = @(
@{name="PHPRC"; value="C:\php"}
)
}
)2
Add-WebConfiguration "/system.webServer/handlers" -Value @{
Name = "PHP_via_FastCGI";
Path = "*.php";
Verb = "GET,HEAD,POST";
Modules = "FastCgiModule";
ScriptProcessor = "C:\php\php-cgi.exe";
ResourceType = "Either";
}3
Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webServer/defaultDocument/files" -name "." -value @{value="index.php"}4
notepad "C:\Windows\System32\inetsrv\config\applicationHost.config"<fastCgi>
<application fullPath="C:\php\php-cgi.exe">
<environmentVariables>
<environmentVariable name="PHPRC" value="C:\php" />
</environmentVariables>
</application>
</fastCgi>🔒 Ajustement des permissions
icacls "C:\php" /grant IUSR:R /T
icacls "C:\php" /grant IIS_IUSRS:R /T
icacls "C:\inetpub\wwwroot" /grant IUSR:R /T
icacls "C:\inetpub\wwwroot" /grant IIS_IUSRS:R /T🌟 Installation de WordPress
1
2
🔍 Résolution des erreurs et activation des logs
1
2
🐬 Installation de MySQL
1
2
3
4
5
6
7
8
🗃️ Configuration de la base de données MySQL
1
2
3
4
5
🔄 Redémarrez IIS
✅ Complétez l'installation de WordPress
Last updated