frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

PHP Extension Doesn't Seem Working

Open Fliw opened this issue 6 months ago • 7 comments

What happened?

Hi, when i using firebase i got error like this when using FrankenPHP Firebase messaging error {"error_type":"GuzzleHttp\\Exception\\ConnectException","error_message":"HTTP/2 is supported by the cURL handler, however libcurl is built without HTTP/2 support.","error_code":0

but when i use FPM it work normally, i've checked the extension that running in frankenPHP and it says Curl is already enabled. i use franken from octane laravel.

Build Type

Custom (tell us more in the description)

Worker Mode

Yes

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

System	Linux Server-UtamaYEC 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
Build Date	May 16 2024 00:45:34
Build System	Linux buildkitsandbox 6.5.0-1021-azure #22~22.04.1-Ubuntu SMP Tue Apr 30 16:08:18 UTC 2024 x86_64 Linux
Configure Command	'./configure' '--prefix=' '--with-valgrind=no' '--enable-shared=no' '--enable-static=yes' '--disable-all' '--disable-cgi' '--disable-phpdbg' '--disable-cli' '--disable-fpm' '--enable-embed=static' '--disable-micro' '--disable-opcache-jit' '--enable-zts' '--disable-zend-signals' '--enable-zend-max-execution-timers' '--enable-apcu' '--enable-bcmath' '--with-bz2=/go/src/app/dist/static-php-cli/buildroot' '--enable-calendar' '--enable-ctype' '--with-curl' '--enable-dba' '--enable-dom' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--enable-ftp' '--with-zlib' '--with-zlib-dir=/go/src/app/dist/static-php-cli/buildroot' '--enable-gd' '--with-freetype' '--with-jpeg' '--with-webp' '--with-avif' '--with-gmp=/go/src/app/dist/static-php-cli/buildroot' '--with-gettext=/go/src/app/dist/static-php-cli/buildroot' '--with-iconv=/go/src/app/dist/static-php-cli/buildroot' '--enable-igbinary' '--with-imagick=/go/src/app/dist/static-php-cli/buildroot' '--enable-intl' '--with-openssl=/go/src/app/dist/static-php-cli/buildroot' '--with-openssl-dir=/go/src/app/dist/static-php-cli/buildroot' '--with-ldap=/go/src/app/dist/static-php-cli/buildroot' '--enable-mbstring' '--enable-mbregex' '--enable-mysqlnd' '--with-mysqli' '--enable-opcache' '--enable-parallel' '--enable-pcntl' '--enable-pdo' '--with-pdo-mysql' '--with-pgsql=/go/src/app/dist/static-php-cli/buildroot' '--with-pdo-pgsql=/go/src/app/dist/static-php-cli/buildroot' '--with-sqlite3=/go/src/app/dist/static-php-cli/buildroot' '--with-pdo-sqlite' '--enable-phar' '--enable-posix' '--enable-protobuf' '--with-readline=/go/src/app/dist/static-php-cli/buildroot' '--enable-session' '--enable-redis' '--enable-redis-session' '--enable-redis-igbinary' '--enable-redis-zstd' '--enable-redis-lz4' '--with-liblz4=/go/src/app/dist/static-php-cli/buildroot' '--enable-shmop' '--enable-simplexml' '--enable-soap' '--enable-sockets' '--with-sodium' '--with-ssh2=/go/src/app/dist/static-php-cli/buildroot' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-tidy=/go/src/app/dist/static-php-cli/buildroot' '--enable-tokenizer' '--with-zip=/go/src/app/dist/static-php-cli/buildroot' '--with-xlswriter' '--enable-reader' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-libxml=/go/src/app/dist/static-php-cli/buildroot' '--with-yaml=/go/src/app/dist/static-php-cli/buildroot' '--enable-zstd' '--with-libzstd=/go/src/app/dist/static-php-cli/buildroot' 'CFLAGS=' 'PKG_CONFIG=/go/src/app/dist/static-php-cli/buildroot/bin/pkg-config' 'PKG_CONFIG_PATH=/go/src/app/dist/static-php-cli/buildroot/lib/pkgconfig'
Server API	FrankenPHP
Virtual Directory Support	enabled
Configuration File (php.ini) Path	/lib
Loaded Configuration File	/home/apps/brofesional-backend/php.ini
Scan this dir for additional .ini files	(none)
Additional .ini files parsed	(none)
PHP API	20230831
PHP Extension	20230831
Zend Extension	420230831
Zend Extension Build	API420230831,TS
PHP Extension Build	API20230831,TS
Debug Build	no
Thread Safety	enabled
Thread API	POSIX Threads
Zend Signal Handling	disabled
Zend Memory Manager	enabled
Zend Multibyte Support	provided by mbstring
Zend Max Execution Timers	enabled
IPv6 Support	enabled
DTrace Support	disabled
Registered PHP Streams	https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp, zip, compress.zstd
Registered Stream Socket Transports	tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
Registered Stream Filters	zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, convert.*, consumed, dechunk

Relevant log output

Firebase messaging error {"error_type":"GuzzleHttp\\Exception\\ConnectException","error_message":"HTTP/2 is supported by the cURL handler, however libcurl is built without HTTP/2 support.","error_code":0}

Fliw avatar Jun 20 '25 02:06 Fliw

this is the phpinfo of FPM that work fine System Linux Server-UtamaYEC 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64 Build Date Jul 8 2023 07:10:21 Build System Linux Server API FPM/FastCGI Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php/8.2/fpm Loaded Configuration File /etc/php/8.2/fpm/php.ini Scan this dir for additional .ini files /etc/php/8.2/fpm/conf.d Additional .ini files parsed /etc/php/8.2/fpm/conf.d/10-mysqlnd.ini, /etc/php/8.2/fpm/conf.d/10-opcache.ini, /etc/php/8.2/fpm/conf.d/10-pdo.ini, /etc/php/8.2/fpm/conf.d/15-xml.ini, /etc/php/8.2/fpm/conf.d/20-bcmath.ini, /etc/php/8.2/fpm/conf.d/20-bz2.ini, /etc/php/8.2/fpm/conf.d/20-calendar.ini, /etc/php/8.2/fpm/conf.d/20-ctype.ini, /etc/php/8.2/fpm/conf.d/20-curl.ini, /etc/php/8.2/fpm/conf.d/20-dom.ini, /etc/php/8.2/fpm/conf.d/20-exif.ini, /etc/php/8.2/fpm/conf.d/20-ffi.ini, /etc/php/8.2/fpm/conf.d/20-fileinfo.ini, /etc/php/8.2/fpm/conf.d/20-ftp.ini, /etc/php/8.2/fpm/conf.d/20-gd.ini, /etc/php/8.2/fpm/conf.d/20-gettext.ini, /etc/php/8.2/fpm/conf.d/20-iconv.ini, /etc/php/8.2/fpm/conf.d/20-intl.ini, /etc/php/8.2/fpm/conf.d/20-mbstring.ini, /etc/php/8.2/fpm/conf.d/20-mysqli.ini, /etc/php/8.2/fpm/conf.d/20-pdo_mysql.ini, /etc/php/8.2/fpm/conf.d/20-phar.ini, /etc/php/8.2/fpm/conf.d/20-posix.ini, /etc/php/8.2/fpm/conf.d/20-readline.ini, /etc/php/8.2/fpm/conf.d/20-shmop.ini, /etc/php/8.2/fpm/conf.d/20-simplexml.ini, /etc/php/8.2/fpm/conf.d/20-sockets.ini, /etc/php/8.2/fpm/conf.d/20-sysvmsg.ini, /etc/php/8.2/fpm/conf.d/20-sysvsem.ini, /etc/php/8.2/fpm/conf.d/20-sysvshm.ini, /etc/php/8.2/fpm/conf.d/20-tokenizer.ini, /etc/php/8.2/fpm/conf.d/20-xmlreader.ini, /etc/php/8.2/fpm/conf.d/20-xmlwriter.ini, /etc/php/8.2/fpm/conf.d/20-xsl.ini, /etc/php/8.2/fpm/conf.d/20-zip.ini PHP API 20220829 PHP Extension 20220829 Zend Extension 420220829 Zend Extension Build API420220829,NTS PHP Extension Build API20220829,NTS Debug Build no Thread Safety disabled Zend Signal Handling enabled Zend Memory Manager enabled Zend Multibyte Support provided by mbstring Zend Max Execution Timers disabled IPv6 Support enabled DTrace Support available, disabled Registered PHP Streams https, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar, zip Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3 Registered Stream Filters zlib.*, string.rot13, string.toupper, string.tolower, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*

Fliw avatar Jun 20 '25 02:06 Fliw

Image

This is output of the static frankenphp binary you get with curl https://frankenphp.dev/install.sh | sh

You selected Build Type: Custom (tell us more in the description), but didn't tell us anything, so I don't know where the issue would be. Also please add a minimal piece of php code to reproduce this, as I suspect the error message may be incorrect.

henderkes avatar Jun 20 '25 13:06 henderkes

<?php

$ch = curl_init('https://www.google.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
curl_exec($ch);

if (curl_errno($ch)) {
    die('CURL error: ' . curl_error($ch));
}

$protocol = curl_getinfo($ch, CURLINFO_HTTP_VERSION);
if ($protocol !== 3) { // CURLINFO_HTTP_VERSION returns 3 for HTTP/2
    die('HTTP/2 not used');
}

echo "HTTP/2 supported and used.\n";
curl_close($ch);

Works in both docker and the static binary (which your phpinfo output indicates).

henderkes avatar Jun 20 '25 13:06 henderkes

the curl info is :

Image

i use octane laravel with server frankenphp, and use nginx as proxy forwarder, here is my nginx config for octane listening

Image

then i use --https when run octane, so nginx hit https, it return only blank with no response from nginx

Image

Fliw avatar Jun 21 '25 03:06 Fliw

This issue might have to be raised with the maintainers of Octane then, FrankenPHP builds with H2 and H3 support.

And I'm not sure why you're using nginx at all when FrankenPHP can directly serve https.

henderkes avatar Jun 21 '25 03:06 henderkes

Okayy thankyou, the docs of laravel says when use for production it must be served over traditional webserver such as nginx, i will add this issue to them.

Fliw avatar Jun 21 '25 05:06 Fliw

They're saying that you should not be using octane (the command to spin up the server) in production at all. You should directly use nginx + fpm or frankenphp, either as a docker image, the (gnu) static binary or the (soon to be released) system packages, currently available for testing here: https://rpms.henderkes.com/

They do not mean that you should be using nginx as a reverse proxy behind octane. That would result in the worst of both worlds.

henderkes avatar Jun 21 '25 06:06 henderkes