Composer update with out allowing in php.ini [allow_url_fopen must be enabled]


PHP Composer installation fails: file could not be downloaded: allow_url_fopen must be enabled…


in case we have antoher option to update the composer with out allowing url_fopnen globally to our cpanel.



If you have composer installed (the package manager for PHP), you can get the following ‘error’ message when you try to run a composer install.

$ composer install

The easiest fix is just to set the allow_url_fopen option to On in php.ini. But that enables it server-wide, you may not want that.

Here's a simple workaround, by setting the option when calling the composer binary.


$ which composer

$ php -d allow_url_fopen=on /usr/local/bin/composer install