如何在 XAMPP 上安装 PHP 8 [英] How to install PHP 8 on XAMPP

查看:55
本文介绍了如何在 XAMPP 上安装 PHP 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的 PHP 版本更新到全新的 PHP 8.我遵循了类似的步骤 教程.但现在显示以下错误:

I'm trying to update my PHP version to the brand new PHP 8. I have followed simular steps as this tutorial. But now the following error is shown:

12:06:23  [Apache]  Error: Apache shutdown unexpectedly.
12:06:23  [Apache]  This may be due to a blocked port, missing dependencies, 
12:06:23  [Apache]  improper privileges, a crash, or a shutdown by another method.
12:06:23  [Apache]  Press the Logs button to view error logs and check
12:06:23  [Apache]  the Windows Event Viewer for more clues
12:06:23  [Apache]  If you need more help, copy and post this
12:06:23  [Apache]  entire log window on the forums

注意:我使用了全新的 XAMPP 安装版本 7.2.33.

Notice: I have used a brand new XAMPP instalation version 7.2.33.

我找不到问题的解决方案.

I can't find the solution for my issue.

编辑这是说我需要查看日志文件,但它们完全是空的,因为它是全新的安装.

Edit It is saying that I need to look into the Log files hower they are completly empty since it's a brand new installation.

这是我的httpd-xampp.conf:

<IfModule env_module>
    SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
    SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
    SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
    SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
    SetEnv PHPRC "\\xampp\\php"
    SetEnv TMP "\\xampp\\tmp"
</IfModule>

#
# PHP-Module setup
#
LoadFile "C:/xampp/php/php8ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadModule php8_module "C:/xampp/php/php8apache2_4.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

#
# PHP-CGI setup
#
#<FilesMatch "\.php$">
#    SetHandler application/x-httpd-php-cgi
#</FilesMatch>
#<IfModule actions_module>
#    Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
#</IfModule>


<IfModule php8_module>
    PHPINIDir "C:/xampp/php"
</IfModule>

<IfModule mime_module>
    AddType text/html .php .phps
</IfModule>

ScriptAlias /php-cgi/ "C:/xampp/php/"
<Directory "C:/xampp/php">
    AllowOverride None
    Options None
    Require all denied
    <Files "php-cgi.exe">
          Require all granted
    </Files>
</Directory>

<Directory "C:/xampp/cgi-bin">
    <FilesMatch "\.php$">
        SetHandler cgi-script
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler None
    </FilesMatch>
</Directory>

<Directory "C:/xampp/htdocs/xampp">
    <IfModule php8_module>
        <Files "status.php">
            php_admin_flag safe_mode off
        </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>

<IfModule alias_module>
    Alias /licenses "C:/xampp/licenses/"
    <Directory "C:/xampp/licenses">
        Options +Indexes
        <IfModule autoindex_color_module>
            DirectoryIndexTextColor  "#000000"
            DirectoryIndexBGColor "#f8e8a0"
            DirectoryIndexLinkColor "#bb3902"
            DirectoryIndexVLinkColor "#bb3902"
            DirectoryIndexALinkColor "#bb3902"
        </IfModule>
        Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
   </Directory>

    Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
    <Directory "C:/xampp/phpMyAdmin">
        AllowOverride AuthConfig
        Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    </Directory>

    Alias /webalizer "C:/xampp/webalizer/"
    <Directory "C:/xampp/webalizer">
        <IfModule php8_module>
            <Files "webalizer.php">
                php_admin_flag safe_mode off
            </Files>
        </IfModule>
        AllowOverride AuthConfig
        Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    </Directory>
</IfModule>

推荐答案

php8_module 重写为 php_module(所有出现的)

Rewriting php8_module to php_module (all occurrences) in

httpd-xampp.conf"文件为我解决了错误:Apache 意外关闭 问题:)

"httpd-xampp.conf" file solved the Error: Apache shutdown unexpectedly problem for me :)

这篇关于如何在 XAMPP 上安装 PHP 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆