Help with composer: proc_open, allow_url_fopen

Skin

Well-Known Member
Feb 3, 2006
93
4
158
Italy
Hello,
I've been using composer without problems for a lot of months, but after the upgrade to cPanel 58 composer stopped working.

I see in the docs that now composer is added in cPanel & WHM, so may be the old composer configuration is in conflict with the new one.

If I run composer diagnose I have the sequent errors:

composer diagnose
Checking platform settings: FAIL

The allow_url_fopen setting is incorrect.
Add the following to the end of your `php.ini`:
allow_url_fopen = On



The php.ini used by your command-line PHP is: /opt/cpanel/ea-php56/root/etc/php.ini
If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.

Checking git settings:

[Symfony\Component\Process\Exception\RuntimeException]
The Process class relies on proc_open, which is not available on your PHP installation.


diagnose
I don't like very much the idea of enabling allow_url_fopen, is there a custom php.ini for composer?

I know i can run
Code:
alias composer="php -d allow_url_fopen=1 -d detect_unicode=0 $(which composer)"
, but it is not a permanent solution.

Same thing for proc_open, I'd like to enable this function only for composer.

Thanks.
 

Skin

Well-Known Member
Feb 3, 2006
93
4
158
Italy
I've just realizad that the suggestion given by composer diagnose ma be a good solution:
The php.ini used by your command-line PHP is: /opt/cpanel/ea-php56/root/etc/php.ini
Is this php.ini used only in command line?

I've edited the suggested php.ini, but the strange thing is that here proc_open is not disabled, the line disable_function is completely clean, so how can enable proc_open?
 

SysSachin

Well-Known Member
Aug 23, 2015
604
48
28
India
cPanel Access Level
Root Administrator
Twitter
I don't like very much the idea of enabling allow_url_fopen, is there a custom php.ini for composer?
I think you are using Easyapache 4. You can try to disable/enable allow_url_fopen through WHM.
Login th WHM >> Software >> MultiPHP INI Editor