从PHP 7.4.26升级到PHP 8.1.0
我在本地主机主页上得到以下错误,尽管网站正在服务器上工作:
ERROR加载的PHP配置文件为:c:/wamp64/bin/PHP/php8.1.0/PHP .ini -应该是:c:/wamp64/bin/apache/apache2.4.51/bin/PHP .ini或c:/wamp64/bin/PHP/php8.1.0/phpforapache.ini你必须执行:右键单击图标Wampmanager ->刷新
- 此文件仅用于PHP命令行。
如何加载正确的php.ini或使错误消失?
谢谢。
更新:请点击下面
截图httpd-vhosts.conf
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "c:/wamp64/www"
<IfModule fcgid_module>
Define FCGIPHPVERSION "8.1.0"
FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
<Files ~ ".php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#
PATH=C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:UsersbhaviAppDataLocalMicrosoftWindowsApps;
httpd . conf中包含:
PHPIniDir "${APACHE_DIR}/bin"
LoadModule php_module "${INSTALL_DIR}/bin/php/php8.1.0/php8apache2_4.dll"
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule fcgid_module>
FcgidMaxProcessesPerClass 300
FcgidConnectTimeout 10
FcgidProcessLifeTime 1800
FcgidMaxRequestsPerProcess 0
FcgidMinProcessesPerClass 0
FcgidFixPathinfo 0
FcgidZombieScanInterval 20
FcgidMaxRequestLen 536870912
FcgidBusyTimeout 120
FcgidIOTimeout 120
FcgidTimeScore 3
FcgidPassHeader Authorization
Define PHPROOT ${INSTALL_DIR}/bin/php/php
</IfModule>
在apache服务器文件中搜索PHPINIDir
。在XAMPP中,它在apacheconfextrahttpd-xampp.conf
下。我的PHPINIDir指令看起来像:
<IfModule php7_module>
PHPINIDir "P:/xampp7.3/php"
</IfModule>