Ich habe eine Frage.
W?hrend der ?nderung der PHP-Version auf PHP 7.1 wurde beim Starten von Apache der folgende Fehler gemeldet:
System: Win7 64-Bit; PHP-Version: PHP7.1.3 Thread Safe 32 vc14;
Apache-Version:
Hinweis: Durch alleiniges Ausführen des PHP-Befehls unter cmd kann phpinfo normal ausgegeben werden, und durch alleiniges ?ffnen von Apache kann auch festgestellt werden, dass es funktioniert! , aber nachdem die folgende Anweisung zu httpd.conf hinzugefügt und dann Apache gestartet wurde, wird die obige Fehlermeldung gemeldet
PHPIniDir ?D:/webSoft/php713“
LoadModule php7_module ?D:/webSoft/php713/php7apache2_4.dll“
Ich habe zuerst online gesucht, weil die vc14-Bibliothek fehlte. Dann habe ich es versucht, aber es hat immer noch nicht funktioniert
httpd -t 測試apache配置有沒有錯命令。
windons下整合apache與php需要添加這三個配置項,apache才能使用PHP服務(wù)去解析PHP文件
LoadModule php7_module "E:/wamp/php-7.0.0-x64/php7apache2_4.dll"
AddType application/x-httpd-php .php .html .htm
PHPIniDir "E:/wamp/php-7.0.0-x64"
我用phpstudy,http.conf文件加載模塊是用LoadModule authz_core_module modules/mod_authz_core.so類似這樣的而不是.dll,而且不用寫絕對路徑,只要把擴(kuò)展文件放在相應(yīng)的目錄下即可
首你要保證 Apache 和 PHP 都是 64 位的,要么都是 32 位
用 php-cgi
無論線程安全,還是非線程安全都可以
httpd.conf
Include "D:\ProgramFiles\Apache24\conf\extra/httpd-php.conf"
httpd-php.conf
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule fcgid_module>
Include "D:\ProgramFiles\Apache24\conf/extra/httpd-fcgid.conf"
FcgidInitialEnv PHPRC "D:/ProgramFiles/php-7.1.3-x64/"
AddHandler fcgid-script .php
FcgidWrapper "D:/ProgramFiles/php-7.1.3-x64/php-cgi.exe" .php
</IfModule>
httpd-fcgid.conf
FcgidIOTimeout 384
FcgidConnectTimeout 360
FcgidOutputBufferSize 128
FcgidMaxRequestsPerProcess 1000
FcgidMinProcessesPerClass 0
FcgidMaxProcesses 16
FcgidMaxRequestLen 268435456
ProcessLifeTime 360
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
附 mod_fcgid 下載
https://www.apachelounge.com/...