<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Custom PHP build configuration?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Can someone point me toward the PHP build configuration that ships with 2.2.3-RELEASE? I've searched GitHub but am I missing it? I'd like to build it myself and maybe update it.</p>
<p dir="auto">I realize that installing upstream FreeBSD packages is unsupported but I find joy in breaking and fixing my personal instance. The PHP version 5.5.26 that ships with 2.2.3-RELEASE has cgi-fcgi built in:</p>
<pre><code>[2.2.3-RELEASE][root@pfsense1]/root: php -v
PHP 5.5.26 (cgi-fcgi) (built: Jun 12 2015 14:20:29)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Suhosin v0.9.37.1, Copyright (c) 2007-2014, by SektionEins GmbH
</code></pre>
<p dir="auto">The upstream FreeBSD build separates the php and php-cgi binaries and doesn't have cgi-fcgi built-in. Php-fpm also behaves differently: the Unix socket writes out the script and Content-Type headers:</p>
<p dir="auto"><strong>PHP pfSense build 5.5.26 (WORKING):</strong></p>
<pre><code>[2.2.3-RELEASE][root@pfsense1]/root: /usr/local/sbin/fcgicli -f /etc/inc/openvpn.tls-verify.php -d "test.test&amp;depth=2&amp;certdepth=1&amp;certsubject=C=US,"; echo; echo $?
OK
0
</code></pre>
<p dir="auto"><strong>PHP FreeBSD build 5.5.27 (BROKEN):</strong></p>
<pre><code>[2.2.3-RELEASE][root@pfsense2]/root: /usr/local/sbin/fcgicli -f /etc/inc/openvpn.tls-verify.php -d "test.test&amp;depth=2&amp;certdepth=1&amp;certsubject=C=US,"; echo; echo $?
Content-type: text/html

#!/usr/local/bin/php -f
OK
0
</code></pre>
<p dir="auto">For me this breaks /usr/local/sbin/ovpn_auth_verify producing <em><strong>"WARNING: Failed running command (–tls-verify script): external program exited with error status: 1"</strong></em> and <em><strong>"VERIFY SCRIPT ERROR"</strong></em> messages since we only match on exactly <strong>"OK"</strong>. So far this hasn't broken anything else that I'm aware of. Here is my patch if you want to continue using 5.5.27 with OpenVPN:</p>
<p dir="auto"><s><em>Note: this may not be a good idea for high traffic OpenVPN servers as we add an extra system call to grep:</em></s></p>
<blockquote>
<p dir="auto">~~–- /usr/local/sbin/ovpn_auth_verify.orig      2015-07-18 19:04:15.000000000 -0600<br />
+++ /usr/local/sbin/ovpn_auth_verify    2015-07-18 19:04:50.000000000 -0600<br />
@@ -9,7 +9,7 @@<br />
        RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.auth-user.php -d "username=$username&amp;password=$password&amp;cn=$common_name&amp;strictcn=$3&amp;authcfg=$2&amp;modeid=$4")<br />
fi</p>
<p dir="auto">-if [ "${RESULT}" = "OK" ]; then<br />
+if echo "${RESULT}" | /usr/bin/grep -E "^OK$" &amp;&gt; /dev/null; then<br />
        exit 0<br />
fi~~</p>
</blockquote>
<p dir="auto"><strong>EDIT: Here is a faster &amp; much more elegant solution:</strong></p>
<pre><code>--- /usr/local/sbin/ovpn_auth_verify.orig       2015-07-18 20:11:02.000000000 -0600
+++ /usr/local/sbin/ovpn_auth_verify    2015-07-19 11:18:16.000000000 -0600
@@ -9,8 +9,11 @@
        RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.auth-user.php -d "username=$username&amp;password=$password&amp;cn=$common_name&amp;strictcn=$3&amp;authcfg=$2&amp;modeid=$4")
 fi

-if [ "${RESULT}" = "OK" ]; then
-       exit 0
-fi
-
-exit 1
+case "$RESULT" in
+   *"OK"*)
+      exit 0
+      ;;
+   *)
+      exit 1
+      ;;
+esac

</code></pre>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.netgate.com/topic/86855/custom-php-build-configuration</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 07:40:15 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/86855.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Jul 2015 17:09:34 GMT</pubDate><ttl>60</ttl></channel></rss>