Solved mod_php70 FreeBSD 10.3 compiler error using ZTS option

wisdown

Active Member

Reaction score: 10
Messages: 113

Hey people,

Someone got stuck compiling the ports www/mod_php70?

I have threaded apache 2.4 installed inside of an jail system, already got www/php70 and lang/php70-extensions compiled successful.

Have added on /usr/local/etc/apache24/httpd.conf:

Code:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
But, when I try load php 7 using:

Code:
LoadModule php7_module        libexec/apache2/libphp7.so
Apache does not start...

Looking on /usr/local/libexec/apache24 there is no libphp7.so.

After read some forums seems the www/mod_php70 need be installed.

Now I am stuck trying compiling it from ports, error says:

Code:
Configuring SAPI modules
checking for Apache 2.0 handler-module support via DSO through APXS... configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads
Is there an command to check if Pthreads are working inside of jail?

Commenting the:

Code:
LoadModule php7_module        libexec/apache2/libphp7.so
Apache start, but, does not load .php files, just ask for download the .php file.

Thanks in advice!
 

obsigna

Aspiring Daemon

Reaction score: 593
Messages: 989

I had the same issue, and I informed the maintainer about this:
Subject: mod_php70 fails building with ZTS support enabled
Message:
Hello!
I switched my installation from php56 to php70. Since I am running www/apache24 with the threaded MPM worker, I need to build the php and the php module with ZTS support enabled. php56 and mod_php56 build fine with ZTS, while mod_php70 bails out in the configure stage:
Code:
Configuring SAPI modules
checking for Apache 2.0 handler-module support via DSO through APXS... configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.
===> Script "configure" failed unexpectedly.
Please report the problem to miwi@FreeBSD.org [maintainer] and attach the
"/usr/ports/www/mod_php70/work/php-7.0.3/config.log" including the output of
the failure of your make command. Also, it might be a good idea to provide
an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
After some troubleshooting, I solved the problem by adding the definition pthreads_working="yes" on line 135 of file /usr/ports/lang/php70. The Makefile of the php56 port got the same definition, and in php70 it was missing for any reason. Anyway that fixed the problem — diff follows:
Code:
--- /usr/ports/lang/php70/Makefile.orig    2016-02-18 10:05:45.000000000 -0200
+++ /usr/ports/lang/php70/Makefile    2016-03-03 21:26:54.144571000 -0300
@@ -132,6 +132,7 @@ CONFIGURE_ARGS+=--with-zend-vm=GOTO
.endif

CONFIGURE_ENV+=    ac_cv_decimal_fp_supported="no" \
+        pthreads_working="yes" \
        lt_cv_path_SED="sed"

.if ${PORT_OPTIONS:MLINKTHR}
I received the following answer from the maintainer:
Hi,

Thanks, I was aware of that problem, but had not time to commit the patch.
Quite obviously, the maintainer still didn't find time since to add the missing configuration parameter pthreads_working="yes" to the port's Makefile. For the time being, I keep on hacking it in manually each time php70 is updated.
 

Kreme

New Member

Reaction score: 2
Messages: 7

I added that line to the Makefile in /usr/ports/www/mod_php70/ but the compile still fails. Any other ideas? (It's been over a year, and this is still broken... sigh)

Edit:
Ah, I see, the Makefile has changed and I wasn't adding the entire block.

Code:
CONFIGURE_ENV+= pthreads_working="yes"
Gets it to compile.
 
Top