2

On Windows 10 Pro, after downloading PHP 8, switching to it in Laragon (PHP > Version) and restarting Apache, I get the following error:

httpd: Syntax error on line 546 of
C:/laragon/bin/apache/httpd-2.4.35-win64-VC15/con...:
Syntax error on line 2 of
C:/laragon/etc/apache2/mod_php.conf: Can't locate
API module structure 'php8_module' in file
C:/laragon/bin/php/php-8.0.2-Win32-vs16-x64/php8a...:
No error
Sammy
  • 335
  • 2
  • 12

2 Answers2

12

After a fair bit of head scratching, the fix was fairly simple - in file

C:/laragon/etc/apache2/mod_php.conf

I changed

LoadModule php8_module to LoadModule php_module

It seems Laragon fouls up the auto-configuration of PHP 8

Sammy
  • 335
  • 2
  • 12
2

GOTO

C:/laragon/etc/apache2/mod_php.conf

AND REPLACE THIS

#This file is auto-generated, so please keep it intact.
LoadModule php8_module "C:/laragon/bin/php/php-8.0.6-Win32-vs16-x64/php8apache2_4.dll"
PHPIniDir "C:/laragon/bin/php/php-8.0.6-Win32-vs16-x64"
<IfModule mime_module>
    AddType application/x-httpd-php .php
</IfModule>

WITH THIS

#This file is auto-generated, so please keep it intact.
LoadModule php_module "C:/laragon/bin/php/php-8.0.6-Win32-vs16-x64/php8apache2_4.dll"
PHPIniDir "C:/laragon/bin/php/php-8.0.6-Win32-vs16-x64"
<IfModule mime_module>
    AddType application/x-httpd-php .php
</IfModule>
code move
  • 21
  • 1