Bug 251411 - www/apache24: mod_php80 (8.0.0.r5): Can't locate API module structure `php8_module' in file /usr/local/libexec/apache24/libphp.so: Undefined symbol "php8_module"
Summary: www/apache24: mod_php80 (8.0.0.r5): Can't locate API module structure `php8_m...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-26 19:36 UTC by freebsd-bugzilla
Modified: 2021-01-10 21:28 UTC (History)
7 users (show)

See Also:
linimon: maintainer-feedback? (apache)


Attachments
Patch against lang/php80 (437 bytes, patch)
2021-01-03 22:07 UTC, Torsten Zuehlsdorff
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description freebsd-bugzilla 2020-11-26 19:36:57 UTC
After installing mod_php80, Apache 2.4 refuses to start with error message
>httpd: Syntax error on line 158 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `php8_module' in file /usr/local/libexec/apache24/libphp.so: Undefined symbol "php8_module"

The offending line:
>LoadModule php8_module        libexec/apache24/libphp.so

Omitting the 8 solves the issue:
>LoadModule php_module        libexec/apache24/libphp.so
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2020-11-27 09:45:41 UTC
^Triage: assign to appropriate maintainer but also notify maintainer of www/mod_php80 .
Comment 2 Sean McBride 2021-01-02 04:02:56 UTC
I encountered this same issue, and removing the "8" character also fixed it for me.
Comment 3 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2021-01-03 22:07:08 UTC
Created attachment 221257 [details]
Patch against lang/php80

I think the changed naming convention in PHP 8.0 causes this problem. I wrote this patch, which - at least - worked in my jail.

But i only tested it against Apache. I have not tested it yet against everything else.

Can you please review it and check if it fixes your problems?

Thank you!
Torsten
Comment 4 Sean McBride 2021-01-07 00:39:00 UTC
I've tried to test this, but I'm afraid I'm over my head here.  I recently setup a poudriere server, which is how I build my Apache/PHP.

I tried the following:

poudriere jail -s -j amd64-12-2
jexec amd64-12-2-default

that got me into the jail, I think.

I see the file to patch:

/usr/ports/lang/php80/Makefile

and use `ee` to open it, but it won't save my changes. :(
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-01-09 23:59:47 UTC
A commit references this bug:

Author: tz
Date: Sat Jan  9 23:59:15 UTC 2021
New revision: 560908
URL: https://svnweb.freebsd.org/changeset/ports/560908

Log:
  lang/php80: Fix "can't locate API module structure `php8_module' in file /usr/local/libexec/apache24/libphp.so"

  Because of the SHORTMODNAME an entry for php8_module was added to httpd.conf when installing www/mod_php80.
  This was an error, because the module is now simple named "php_module".

  PR:		251411
  Reported by:	<freebsd-bugzilla@b-society.se>
  Sponsored by:	PHP Update Service

Changes:
  head/lang/php80/Makefile
Comment 6 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2021-01-10 00:00:30 UTC
Thank you Sean for your testing attempts! I tested it now on my own and think it is good enough. :)
Comment 7 Sean McBride 2021-01-10 00:10:35 UTC
Thanks for the fix!  Is a new port now live?  I can test that at least...
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-01-10 21:20:58 UTC
A commit references this bug:

Author: tz
Date: Sun Jan 10 21:20:01 UTC 2021
New revision: 561111
URL: https://svnweb.freebsd.org/changeset/ports/561111

Log:
  MFH: r560908

  lang/php80: Fix "can't locate API module structure `php8_module' in file /usr/local/libexec/apache24/libphp.so"

  Because of the SHORTMODNAME an entry for php8_module was added to httpd.conf when installing www/mod_php80.
  This was an error, because the module is now simple named "php_module".

  PR:		251411
  Reported by:	<freebsd-bugzilla@b-society.se>
  Sponsored by:	PHP Update Service

Changes:
_U  branches/2021Q1/
  branches/2021Q1/lang/php80/Makefile
Comment 9 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2021-01-10 21:28:08 UTC
> Thanks for the fix!  Is a new port now live?  I can test that at least...

It is committed on head and now in quarterly. So if you build the ports by yourself: yes. If you use pkg it maybe needs a while until the packages are build.