• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved [EXTPHPCOMP-91] Composer extension Problems

Danny325

Basic Pleskian
The new Composer feature looks insane (dont need to login as this user and pass ssh rights for this time anymore), but i have various problems running this.
I have the following packages already installed over ssh:
{
"require": {
"phpmailer/phpmailer": "^6.1",
"dompdf/dompdf": "^0.8.3",
"symfony/polyfill-mbstring": "^1.12",
"psr/log": "^1.1",
"braintree/braintree_php": "^4.4.0"
}
}

Now if i open the Composer feature on the domain subscription i got following errors while he tryes to get package informations:
  • Changed current directory to /var/www/vhosts/xxxx.it/.composer
  • The "https://repo.packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out
  • Packagist could not be fully loaded, package information was loaded from the local cache and may be out of date
  • [Composer\Downloader\TransportException]
  • The "http://repo.packagist.org/p/plesk/c...6e22553c309925e163ebee3f7bb48234a8ecf0fe.json" file could not be downloaded: failed to open stream: Connection timed out
  • require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
 
Hi,

Based on the error description you provided, it seems that packagist.org (main repository of composer packages) is not available from your server.
If so, then PHP Composer can't load necessary plugins/packages from this repo that prevents it to work properly.
You can check this case with commands like (should be execute from your server using SSH):
curl http://repo.packagist.org/p/plesk/composer-command-info$18c4d3244f46070fc69d08656e22553c309925e163ebee3f7bb48234a8ecf0fe.json
or
curl https://repo.packagist.org/packages.json

No i can run this as root user as well as non root user.
On another subsricption it works with dompdf alone.
No clue what the problem is, running this witouth the extension works witouth problems.
 
Hi,

We would be grateful if you would give us more detailed information by mistake:
1. The full content of your composer.json
2. Content of /.composer/config.json (if file exists)
3. Content of /.composer/composer.json (if file exists)
4. Domain PHP version
5. Operating system
6. What PHP do you use to run composer via SSH? System PHP or domain PHP?
7. Does your server support ipv6? Can you check if curl --ipv6 'https://packagist.org/packages.json' and curl --ipv4 'https://packagist.org/packages.json' work?
8. Please add a temporary config.json file to the /.composer directory with the following content
and open the application once again.

{
"config": {},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.org"
}
}
}

Thank you!
 
Last edited:
Oh i found the Problem now.
allow_url_fopen have to be enabled in the php.ini settings of the php version used, even tough it is enabled in the subscription settings.
Thats a good thing i guess, so it can be stayed disabled for the subscription itself.

Just a thing to know.
 
Last edited:
Oh i found the Problem now.
allow_url_fopen have to be enabled in the php.ini settings of the php version used, even tough it is enabled in the subscription settings.
Thats a good thing i guess, so it can be stayed disabled for the subscription itself.

Just a thing to know.

@Danny325 Hi,
Thanks for the report! We considered this as a software issue EXTPHPCOMP-91 (wrong php.ini was used by PHP Composer).
We are going to fix this in the upcoming PHP Composer 1.0.2 this week.
 
@Danny325 Hi,
Thanks for the report! We considered this as a software issue EXTPHPCOMP-91 (wrong php.ini was used by PHP Composer).
We are going to fix this in the upcoming PHP Composer 1.0.2 this week.
In my opinion you shoulnd change anything. If you change the php ini to php vendor people get problems with older oses running.
If you change it to subscription php.ini setting people are forced to enable allow_url_fopen, wich can be a security issue.
Just let it stay like it is and bring an error message that it must be enabled on the main php.ini version used, standard its even enabled by default i think.
 
@Danny325 Hi,

In a previous post, you wrote that you successfully run composer via ssh: "No i can run this as root user as well as non root user".
What PHP did you use to run composer via SSH? Why is the error associated with the 'allow_url_fopen' php.ini parameter not occurred in this case? Did you use System PHP or domain PHP?
 
Over SSH runs vendor php, wich is installed together with os ubuntu 18.04 in my case.
This php i didnt configured as i did with my domains one.

When you run composer over SSH then the problem is that the vendor php is very old. For example if you run Ubuntu 16.04 you got ~vendor php 7.0.
In that case some composer packages like braintree arent able to run never versions and you sit for a long time on outdated versions.
If you didnt migrate to a newer os or install a new vendor php wich can be very tricky and make problems you cant solv this problem.

So it is great this composer extension uses the php version you have installed on plesk, not the vendor one. In case you need to upgrade php you can only swap to a newer domain php for this subscription.
 
Last edited:
Back
Top