• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • 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