Bug #60794 [Opn->Fbk]: Cannot include files from different .phars when include path is too long

From: Date: Tue, 19 Jan 2021 14:52:34 +0000
Subject: Bug #60794 [Opn->Fbk]: Cannot include files from different .phars when include path is too long
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231645@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60794&edit=1 ID: 60794 Updated by: cmb@php.net Reported by: pdobrigkeit at gmx dot de Summary: Cannot include files from different .phars when include path is too long -Status: Open +Status: Feedback Type: Bug Package: PHAR related Operating System: Windows 7 PHP Version: 5.3.9 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Yes, this is likely MAXPATHLEN related. Since the phars are no longer available, I can't easily test, but I assume this issue is practically resolved as of PHP 7.1.0 which introduces support for long paths and defines MAXPATHLEN to 2048 on Windows. Or can anybody still reproduce this with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2015-04-24 15:22:08] massimo dot lombardo at chiarezza dot it I've the same problem PHP Version 5.3.17 running on windows 7 ------------------------------------------------------------------------ [2012-06-07 19:26:39] mattficken@php.net I can't reproduce this error with 5.3.8-TS or 5.3.14rc2-NTS on Windows 7. I've posted the output of the test script above for 5.3.8-TS. The test script doesn't pass regardless of turning off the str_pad calls. Could there be something wrong with the 2 phar files themselves? What INI directives are you using? The PHAR section of my INI file is: [Phar] ;phar.readonly = On ; http://php.net/phar.require-hash ;phar.require_hash = On ;phar.cache_list = I am using the official 5.3.8 build, which has PHAR builtin. With both set_include_path() calls commented out (ie it should work): PHP Warning: include(autoload/autoload.php): failed to open stream: No such fil e or directory in C:\php-sdk\php-5.3.8-Win32-VC9-x86\60794.php on line 17 Warning: include(autoload/autoload.php): failed to open stream: No such file or directory in C:\php-sdk\php-5.3.8-Win32-VC9-x86\60794.php on line 17 PHP Warning: include(): Failed opening 'autoload/autoload.php' for inclusion (i nclude_path='.;C:\php\pear') in C:\php-sdk\php-5.3.8-Win32-VC9-x86\60794.php on line 17 Warning: include(): Failed opening 'autoload/autoload.php' for inclusion (includ e_path='.;C:\php\pear') in C:\php-sdk\php-5.3.8-Win32-VC9-x86\60794.php on line 17 PHP Fatal error: Call to undefined function autoload() in C:\php-sdk\php-5.3.8- Win32-VC9-x86\60794.php on line 20 Fatal error: Call to undefined function autoload() in C:\php-sdk\php-5.3.8-Win32 -VC9-x86\60794.php on line 20 With the second set_include_path() call uncommented (so it should fail), I get: included file phar://C:/php-sdk/php-5.3.8-Win32-VC9-x86/libA.phar/libA/libA.phpP HP Warning: include(libA/libA.php): failed to open stream: No such file or dire ctory in phar://C:/php-sdk/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autolo ad.php on line 5 Warning: include(libA/libA.php): failed to open stream: No such file or director y in phar://C:/php-sdk/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autoload.p hp on line 5 PHP Warning: include(): Failed opening 'libA/libA.php' for inclusion (include_p ath='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa;phar://libA.phar;phar://autoload.phar') in phar://C:/ php-sdk/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autoload.php on line 5 Warning: include(): Failed opening 'libA/libA.php' for inclusion (include_path=' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa;phar://libA.phar;phar://autoload.phar') in phar://C:/php-s dk/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autoload.php on line 5 With the 2nd set_include_path() commented out and the 1st uncommented (so it should pass), instead I get: included file phar://C:/php-sdk/php-5.3.8-Win32-VC9-x86/libA.phar/libA/libA.phpP HP Warning: include(libA/libA.php): failed to open stream: No such file or dire ctory in phar://C:/php-sdk/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autolo ad.php on line 5 Warning: include(libA/libA.php): failed to open stream: No such file or director y in phar://C:/php-sdk/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autoload.p hp on line 5 PHP Warning: include(): Failed opening 'libA/libA.php' for inclusion (include_p ath='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa;phar://libA.phar;phar://autoload.phar') in phar://C:/p hp-sdk/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autoload.php on line 5 Warning: include(): Failed opening 'libA/libA.php' for inclusion (include_path=' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa;phar://libA.phar;phar://autoload.phar') in phar://C:/php-sd k/php-5.3.8-Win32-VC9-x86/autoload.phar/autoload/autoload.php on line 5 ------------------------------------------------------------------------ [2012-06-04 17:01:49] pajoye@php.net For the record here. This is certainly due to MAXPATHLEN check in the stream implementation. The question now is to verify where it fails, whether in stream core itself or in phar. If the sooner, we have some kind of a problem here and could be harder to solve. Temporary work around would be to use aliases. ------------------------------------------------------------------------ [2012-04-12 21:11:35] alex dot bowyer at googlemail dot com I have the same problem on PHP 5.3.10 / Windows Server 2008 / IIS 7.5. We have a workaround for now but soon the 218 character limit is going to be an issue for us. Hope you can fix it! ------------------------------------------------------------------------ [2012-01-19 10:39:19] s dot kleff at dershao dot de Works as expected on PHP Version 5.3.8-ZS5.5.0 / Debian 2.6.32-5-amd64 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=60794 -- Edit this bug report at https://bugs.php.net/bug.php?id=60794&edit=1

« previous php.bugs (#231645) next »