• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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