Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

krishna9720's avatar

Error The "https://packagist.org/packages.json" file could not be downloaded:

Hi experts,

totally tired with a strange issue please help

When I was accessed my GoDaddy server with SSH and hit commands with like composer handling

for example

composer update

Every time getting this error after running the composer command.

[Composer\Downloader\TransportException]                                                                                                    
  The "https://packagist.org/packages.json" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is di  
  sabled in the server configuration by allow_url_fopen=0                                                                                     
  failed to open stream: no suitable wrapper could be found) 

After this, i have also enabled the value of allow_file_fopen to enable in my WHM machine and application but still getting the same issue.

Anybody have any idea that why it is doing like this?

Thanks

0 likes
5 replies
mvd's avatar

Did you restart the WHM machine?

krishna9720's avatar

@mvd I did that after the changes but does not work well. I checked it with the command also it shows allow_url_fopen is on. But still when I hit the command for composer update still display the same error.

mvd's avatar

Hmmm other suggestions

Try

php --ini

To see if multiple ini files are loaded

Or run

if (ini_get("allow_url_fopen") == 'On') {
echo "allow_url_fopen is ON";
} else {
echo "allow_url_fopen is OFF";
}   

To check if allow_url_fopen is really on.

krishna9720's avatar

@mvd I checked it 's showing allow_url_fopen is ON but when I hit the composer commands the error still occurs what I have mentioned in the question. After changes the php.ini also I restarted Apache server. But does not work.

Please help why it's happening like this.

Thanks K

mvd's avatar

Can't test it now, but does this works?

php -d allow_url_fopen=on /full-path-to-composer update

Please or to participate in this conversation.