Page 1 of 1

Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Sat Oct 24, 2020 8:11 pm
by CraigNel

I have updated composer to the latest version

Now when i generate and view the project i get the following error

Fatal error: Interface 'Psr\Http\Message\RequestFactoryInterface' not found in C:\xampp\htdocs\sb\vendor\nyholm\psr7\src\Factory\Psr17Factory.php on line 14

Has anyone come across this and have any recommendations for me.


Re: Fatal error: Interface 'Psr\Http\Message\RequestFactoryInterface'

Posted: Sun Oct 25, 2020 10:47 am
by arbei

You may try to delete the "vendor" folder and composer.json in the project folder and enable "Composer update" in PHPMaker to make Composer run update and create the "vendor" folder again. (Make sure you use the latest version, v2021.0.3, as of today.)


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Mon Oct 26, 2020 10:55 pm
by CraigNel

Hi.

That folder is not being produced

I have the following
container
http-message
http-server-handler
http-server-middleware
log


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Mon Oct 26, 2020 11:26 pm
by CraigNel

HI all.

I have got it working.

You can't do a manual install of composer. You need to:

Install composer on windows (Using the windows install file). Then navigate to C:\ProgramData\ComposerSetup\bin and replace the composer.phar with version 1.10.16.
Restart the computer.
Run cmd and enter: Composer clearcache
Open Phpmaker 2021
Navigate to tools, clear template cache.
now regenerate your project with the composer update enabled.. (remember to delete the project generation)


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Tue Oct 27, 2020 9:10 am
by Webmaster

Bug of Composer v2.0.0-2.0.2. Composer v2.0.3 (released on 2020/10/28) has fixed the problem.


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Thu Oct 29, 2020 6:26 am
by Lazar

Great, it works. Thank You !


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Mon Dec 27, 2021 2:45 pm
by Roland

I have the same problem:

Fatal error: Uncaught Error: Interface 'Psr\Http\Message\RequestFactoryInterface' not found in C:\Xampp\htdocs\caleven\vendor\nyholm\psr7\src\Factory\Psr17Factory.php:16

using PhpMaker 2022.8.0 on Xampp (PHP Version 7.4.27)

Checking composer, I got

C:\Xampp\htdocs\caleven>composer -V
Composer version 2.2.1 2021-12-22 22:21:31

C:\Xampp\htdocs\caleven>composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
12 packages you are using are looking for funding.
Use the composer fund command to find out more!

C:\Xampp\htdocs\caleven>

Checking vendor\composer\autoload_static.php, I just have (lines 152-155)

    'Psr\\Http\\Message\\' => 
    array (
        0 => __DIR__ . '/..' . '/psr/http-message/src',
    ),

It works with composer.phar version 1.10.16.

Any help would be very appreciated.


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Thu Jan 06, 2022 7:58 am
by arbei

For unknown reason Composer v2.2.x removes psr/http-factory so the interface 'Psr\Http\Message\RequestFactoryInterface' not found.

It seems that Composer v2.2.3 has fixed the issue, there is no need to downgrade Composer, you may open a command prompt and update composer itself by entering:

composer selfupdate


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Fri Jan 06, 2023 12:48 am
by lopezjorgel

I recently installed PHPMaker ver2021.0.15 for the first time on my Windows 11 PC and get the same error. Composer is up to date. I have tried just about everything suggested in this post without success. Always get the following error

Fatal error: Interface 'Psr\Http\Message\RequestFactoryInterface' not found in H:\OneDrive\Veronica\My Documents\inetpub\wwwroot\eduxys.com\httpdocs\reports\prfipr2022\vendor\nyholm\psr7\src\Factory\Psr17Factory.php on line 16.

Any suggestions appreciated.


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Fri Jan 06, 2023 9:36 am
by arbei

lopezjorgel wrote:

Fatal error: Interface 'Psr\Http\Message\RequestFactoryInterface' not found in H:\OneDrive\Veronica\...'

Avoid generating to OneDrive (e.g. X:\OneDrive\...) or other mapped drive in which you may not have write permission.

After generation, make sure:

  1. You can run composer without errors (open command prompt and run composer -V),
  2. You have generated composer.json and run "composer update" without errors,
  3. The "vendor" folder is generated under the project folder,
  4. You upload all generated scripts and the "vendor" folder to your development/production server.

You should also enable Debug and check for any PHP errors in the log files.


Re: Interface 'Psr\Http\Message\RequestFactoryInterface' not found

Posted: Mon Jul 31, 2023 4:42 pm
by philmills

I hit a similar error:
Uncaught Error: Interface "Psr\Http\Message\UriFactoryInterface" not found in /[path]/vendor/nyholm/psr7/src/Factory/Psr17Factory.php
Got it all working now.
I had my project files stored on a mapped drive and couldn't update composer via CMD there.
Moving the project, updating composer, then regenerating files fixed the issue