Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PuPHPeteer php bridge package unable to install on Laravel 9

This package nesk/puphpeteer has been archived and doesn't work with Laravel 9 anymore. There are however forks that I believe will work with Laravel 9 since the dependencies in the composer errors have been updated in the forks. I tried these steps in the composer docs but can't seem to install a fork as a composer dependency. Any guidance in the right direction would be appreciated.

In my composer.json I have these new entries.

{
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/NigelCunningham/puphpeteer.git"
    }
],
"require": {
    "nesk/puphpeteer": "dev-dev"
}

}

When I run composer update I get the following error:

"Your requirements could not be resolved to an installable set of packages. 

Problem 1
    - Root composer.json requires nesk/puphpeteer dev-dev -> satisfiable by nesk/puphpeteer[dev-dev]."
like image 921
dfeva Avatar asked Dec 13 '25 13:12

dfeva


2 Answers

Summary

At the time of writing this post, https://github.com/NigelCunningham/puphpeteer.git isn't ready for Laravel 9.

Explanation

I tried installing it on the first stable version of Laravel v9.0.0 (composer create-project laravel/laravel example-app 9.0.0).

composer.json (new entries)

{
    "repositories": [
        {
            "url": "https://github.com/NigelCunningham/puphpeteer.git",
            "type": "git"
        }
    ],
    "require": {
        "nigelcunningham/puphpeteer": "^2.0.0"
    },

    "minimum-stability": "dev"
}

You may need to install or enable PHP's sockets extension.

It threw the error below: composer update

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/process[v4.0.0-BETA1, ..., v4.4.10] require php ^7.1.3 -> your php version (8.1.6) does not satisfy that requirement.
    - symfony/process[v5.0.0-BETA1, ..., v5.0.0-RC1] require php ^7.2.9 -> your php version (8.1.6) does not satisfy that requirement.
    - symfony/process[v5.0.0, ..., v5.1.0-RC1] require php ^7.2.5 -> your php version (8.1.6) does not satisfy that requirement.
    - Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[v9.0.0-beta.1, ..., 9.x-dev].
    - Root composer.json requires nigelcunningham/puphpeteer ^2.0.0 -> satisfiable by nigelcunningham/puphpeteer[2.0.0].
    - Conclusion: don't install symfony/console[v6.0.19] | install symfony/process[v5.4.19] (conflict analysis result)
    - Conclusion: don't install symfony/console[v6.0.3] | install symfony/process[v5.4.19] (conflict analysis result)
    - Conclusion: don't install nunomaduro/collision[v6.4.0] | install symfony/process[v5.4.19] (conflict analysis result)
    - Conclusion: don't install symfony/process v5.4.19 (conflict analysis result)
    - Conclusion: don't install symfony/console[v6.2.5] | install symfony/process[v5.4.19] (conflict analysis result)
    - nigelcunningham/puphpeteer 2.0.0 requires nesk/rialto ^1.2.0 -> satisfiable by nesk/rialto[1.2.0, 1.2.1, 1.3.0, 1.4.0].
    - nesk/rialto 1.4.0 requires symfony/process ^3.3|^4.0|^5.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].
    - nesk/rialto[1.2.0, ..., 1.3.0] require symfony/process ^3.3|^4.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev].
    - symfony/console 6.3.x-dev conflicts with symfony/process v5.3.14.
    - symfony/console 6.3.x-dev conflicts with symfony/process v5.3.2.
    - symfony/console 6.3.x-dev conflicts with symfony/process v5.0.11.
    - symfony/console 6.3.x-dev conflicts with symfony/process v4.4.44.
    - symfony/console 6.3.x-dev conflicts with symfony/process v4.4.26.
    - symfony/console 6.3.x-dev conflicts with symfony/process v3.4.47.
    - symfony/console 6.3.x-dev conflicts with symfony/process v3.3.6.
    - nunomaduro/collision[v6.1.0, ..., v6.2.1] require symfony/console ^6.0.2 -> satisfiable by symfony/console[v6.0.2, ..., 6.3.x-dev].
    - Root composer.json requires nunomaduro/collision ^6.1 -> satisfiable by nunomaduro/collision[v6.1.0, ..., v6.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

If you aim your focus on this line below:

- nigelcunningham/puphpeteer 2.0.0 requires nesk/rialto ^1.2.0 -> satisfiable by nesk/rialto[1.2.0, 1.2.1, 1.3.0, 1.4.0].

The package nigelcunningham/puphpeteer requires the dependency nesk/rialto, whose latest version dev-dev requires symfony/process: ^3.3|^4.0|^5.0. Unfortunately, Laravel v9.0.0 (laravel/framework) requires symfony/process: ^6.0 making it incompatible.


Moving forward, in your question, you declared a required dependency in your composer.json file "nesk/puphpeteer": "dev-dev". This follows the same incompatibility issue with Laravel v9.0.0 as explained above.

It threw the error below: composer update

 - nesk/puphpeteer dev-dev requires nesk/rialto ^1.2.0 -> satisfiable by nesk/rialto[1.2.0, 1.2.1, 1.3.0, 1.4.0].
    - nesk/rialto 1.4.0 requires symfony/process ^3.3|^4.0|^5.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].

Addendum

Comment from the OP (dfeva)

Thanks for the great answer! it looks like this nesk/rialto fork is updated to symphony/process ^6.0. github.com/zoonru/rialto/blob/zoon/composer.json. How can I install that first so then I should be able to install github.com/zoonru/puphpeteer if im understating correctly. Thanks for your help!

To achieve that, you can use:

composer.json (new entries)

{
    "repositories": [
        {
            "url": "https://github.com/zoonru/rialto.git",
            "type": "git"
        },
        {
            "url": "https://github.com/zoonru/puphpeteer.git",
            "type": "git"
        }
    ],
    "require": {
        "nesk/puphpeteer": "dev-master"
    },

    "minimum-stability": "dev"
}

The unfortunate news is that, at the time of writing this post, the latest git tag (Version 1.4.0 released on Apr 12, 2020) for the zoonru/rialto dependency depended on the old "symfony/process": "^3.3|^4.0|^5.0" versions.

The newer changes linked in your comment aiming at supporting new Symfony components ("symfony/process": "^3.3 || ^4.0 || ^5.0 || ^6.0") were made at a later date, Aug 16, 2022. Sadly, a newer git tag reflecting these changes hasn't been officially released yet. 😑

Temporary Solution (use with caution)

If you still insist on wanting to install zoonru/puphpeteer, you may need to fork https://github.com/zoonru/rialto and create a new git tag reflecting the newer changes that were made on the repository.

Steps

  1. Fork the zoonru/rialto repository. Read Forking a repository.
  2. Clone your forked version of the repository. Read Cloning a repository
  3. Create an annotated git tag on your forked repository version. Read Create a tag in a GitHub repository
    • At the root path of your forked repository, open your terminal. Run the command: git tag 1.5.0 -a to create a new git tag. (Include a description with your tag. I.e: Version 1.5.0)
    • Push your new git tag to your remote forked repository using the command: git push origin --tags
  4. You should now be able to see your latest git tag on your remote forked repository. I.e: https://github.com/steven7mwesigwa/rialto/tags
    • https://github.com/YOUR-GITHUB-USERNAME-HERE/rialto/tags
  5. Now, in your Laravel project's composer.json file, instead of https://github.com/zoonru/rialto.git, use your newly forked remote repo version. I.e: https://github.com/steven7mwesigwa/rialto.git

composer.json (new entries)

{
    "repositories": [
        {
            "url": "https://github.com/steven7mwesigwa/rialto.git",
            "type": "git"
        },
        {
            "url": "https://github.com/zoonru/puphpeteer.git",
            "type": "git"
        }
    ],
    "require": {
        "nesk/puphpeteer": "dev-master"
    },

    "minimum-stability": "dev"
}

You may replace https://github.com/steven7mwesigwa/rialto.git with your new forked remote repo URL instead.

  1. At the root of your Laravel project, open the terminal, and run the command composer update which will install zoonru/puphpeteer.

Sample output

A. composer show nesk/rialto -a

PS C:\xampp\htdocs\example-app> composer show nesk/rialto -a
name     : nesk/rialto
descrip. : Manage Node resources from PHP
keywords : php, node, wrapper, communication, bridge, socket
versions : 1.5.0, 1.4.0, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.2, 1.0.1, 1.0.0, 0.1.2, 0.1.1, 0.1.0, dev-zoon, dev-dev
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source   : [git] https://github.com/steven7mwesigwa/rialto.git c6ffad796941eaaf166c089f116a762f1c79d2e4
dist     : []
names    : nesk/rialto

autoload
psr-4
Nesk\Rialto\ => src/

requires
php ^7.2 || ^8.0
clue/socket-raw ^1.2
psr/log ^1.0 || ^2.0 || ^3.0
symfony/process ^3.3 || ^4.0 || ^5.0 || ^6.0

requires (dev)
monolog/monolog ^1.0 || ^2.0 || ^3.0
phpunit/phpunit ^8.0 || ^9.0

suggests
ext-weakref Required to run all the tests

B. composer update

PS C:\xampp\htdocs\example-app> composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 4 installs, 1 update, 0 removals
  - Locking clue/socket-raw (v1.6.0)
  - Locking nesk/puphpeteer (dev-master 52bd425)
  - Locking nesk/rialto (1.5.0)
  - Downgrading psr/log (3.0.0 => 1.1.4)
  - Locking vierbergenlars/php-semver (v3.0.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 4 installs, 1 update, 0 removals
  - Syncing nesk/rialto (1.5.0) into cache
  - Syncing nesk/puphpeteer (dev-master 52bd425) into cache
  - Downgrading psr/log (3.0.0 => 1.1.4): Extracting archive
  - Installing vierbergenlars/php-semver (v3.0.3): Extracting archive
  - Installing clue/socket-raw (v1.6.0): Extracting archive
  - Installing nesk/rialto (1.5.0): Cloning c6ffad7969 from cache
  - Installing nesk/puphpeteer (dev-master 52bd425): Cloning 52bd42570e from cache
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   INFO  Discovering packages.

  fruitcake/laravel-cors ........................................................................................ DONE
  laravel/sail .................................................................................................. DONE
  laravel/sanctum ............................................................................................... DONE
  laravel/tinker ................................................................................................ DONE
  nesbot/carbon ................................................................................................. DONE
  nunomaduro/collision .......................................................................................... DONE
  nunomaduro/termwind ........................................................................................... DONE
  spatie/laravel-ignition ....................................................................................... DONE

84 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force

   INFO  No publishable resources for tag [laravel-assets].

No security vulnerability advisories found

Hopefully, you will remember to replace your forked repository URL I.e: https://github.com/steven7mwesigwa/rialto.git with the original https://github.com/zoonru/rialto.git repo URL in your Laravel project's composer.json file and reinstall zoonru/puphpeteer once zoonru/rialto releases a new official git tag when that time comes.

like image 174
steven7mwesigwa Avatar answered Dec 16 '25 21:12

steven7mwesigwa


As of writing spatie/browsershot is the best solution for my problem. It supports Laravel 10 and no changes to code are needed to make it work. It does about what nesk/puphpeteer did and has an active community.

like image 37
dfeva Avatar answered Dec 16 '25 21:12

dfeva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!