• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Issue PHP Composer issue trying to install GoCardless library

Simon1

New Pleskian
Server operating system version
CentOS Linux 7.9.2009 (Core)
Plesk version and microupdate number
Plesk Obsidian v18.0.55_build1800230919.07 os_CentOS 7
Hello,

I'm trying to install the GoCardless library into a site in my Plesk server.

The instructions say to try this from the command line having cd'd to the root directory of the site in question:

composer require gocardless/gocardless-pro​

However that gets me this:

/usr/bin/env: php: No such file or directory​

So next up I tried uploading the composer.json that's listed in github, using the Plesk Composer GUI.

For completeness, that looks like this:

{​
"name": "gocardless/gocardless-pro",​
"description": "GoCardless Pro PHP Client Library",​
"version": "5.3.0",​
"keywords": [​
"gocardless",​
"direct debit",​
"api"​
],​
"license": "MIT",​
"authors": [​
{​
"name": "GoCardless and contributors",​
}​
],​
"require": {​
"php": ">=8.1",​
"ext-curl": "*",​
"ext-json": "*",​
"ext-mbstring": "*",​
"guzzlehttp/guzzle": "^7.4"​
},​
"require-dev": {​
"phpunit/phpunit": "^9.5",​
"squizlabs/php_codesniffer": "^3.6",​
"php-coveralls/php-coveralls": "^2.4"​
},​
"autoload": {​
"psr-4": {​
"GoCardlessPro\\" : "lib/"​
}​
},​
"autoload-dev": {​
"psr-4": {​
"GoCardlessPro\\": "tests/"​
}​
}​
}​

After that 'something' happened in that the vendor directory on my site changed. However when I try the test script

require 'vendor/autoload.php​
$client = new \GoCardlessPro\Client(​
...​
I get this error:

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class "GoCardlessPro\\Client" not found in /var/www/vhosts/0maths.com/httpdocs/test.php:9\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/0maths.com/httpdocs/test.php on line 9'​

So that's not a success either. Am I using the Plesk composer uploader right? Am I supposed to be doing something other than uploading the composer.json file?

I'm arguably the wrong man for the job as I'm new to Plesk, new to GoCardless and new to PHP Composer. Yet here we are.

I'd certainly appreciate any help.
 
The problem appears to be that neither php nor composer.phar are where expected.

What sort of worked (but not entirely) is

/opt/plesk/php/8.1/bin/php /usr/lib64/plesk-9.0/composer.phar require gocardless/gocardless-pro

I'm now getting the error

Root package 'gocardless/gocardless-pro' cannot require itself in its composer.json

I guess a different error is progress...
 
Back
Top