How to upgrade php 7 to 8 in windows

Download XAMPP zip folder or you can use below link for download XAMPP zip folder

XAMPP – Browse /XAMPP Windows/8.2.12 at SourceForge.net

  • Extract the zip folder
  • Copy PHP folder from XAMPP directory
  • Now rename or remove your existing php folder (of php 7)
  • Replace or paste your new php folder in your current installed xampp directory
  • Open XAMPP, click on config and then open httpd-xampp.conf file.

Replace php7 with php8 with dll inside PHP-Module Setup

OR Replace httpd-xampp.conf file with below content

#
# XAMPP settings
#

<IfModule env_module>
    SetEnv MIBDIRS "E:/xampp/php/extras/mibs"
    SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
    SetEnv OPENSSL_CONF "E:/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 "E:/xampp/php/php8ts.dll"
LoadFile "E:/xampp/php/libpq.dll"
LoadModule php_module "E:/xampp/php/php8apache2_4.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 "E:/xampp/php"
</IfModule>

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

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

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

<Directory "E:/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 "E:/xampp/licenses/"
    <Directory "E:/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 "E:/xampp/phpMyAdmin/"
    <Directory "E:/xampp/phpMyAdmin">
        AllowOverride AuthConfig
        Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    </Directory>

    Alias /webalizer "E:/xampp/webalizer/"
    <Directory "E:/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>

Keep Learning 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *