Hi,
I am new here. I have a problem, I am trying to get the Composer PHP Dependency Manager to self-update and to perform the other tasks that it is designed to do. However, it is not working. I don't know much about this and I'm trying to figure this out. I'd appreciate any help that you can give. From an amateur's point of view, I think that there are some settings and/or files in cPanels/files that need to be fixed or corrected, etc. I think that at least part of the problem is getting "allow_url_fopen=0" set correctly in the php.ini file. I am trying to give as much detail as possible so that you can show me what the problem is or what I am doing wrong and what I should do to fix it.
Here is what I have been trying:
I am trying to get Composer working in my shared hosting cPanel account. Composer was installed a little over a year ago, but I haven't used it. I've only recently been trying to learn how to use it. Only I'm having problems with getting it to work and I think that problem have to be solved in cPanel first. After that I'll work on getting Composer working and learning it.
First, I'm trying to update composer to the lastest version. Using PuTTY, from within the cPanel files home directory I entered [~]# composer self-update. This was the error message that I received.
Trying to learn a little more about the problem, I entered [~]# composer diagnose into PuTTy. I received this message:
So, I went into the cPanel main window and under the Software Category, I found the MultiPHP INI Editor, which I opened. In the "Editor Mode" window I chose the --Select a location-- menu and then chose "Home Directory"
Path /home/username/php.ini PHP Version ea-php72
This is the text of the php.ini file that is in the cPanel Files home directory:
I had previously added lines 20 & 21, which had no effect. When I tried to do other [~]# composer self-update I still had the below error:
Could someone help me figure out how to get the settings and or files corrected or installed so that I can start on getting Composer working and learning it? Thanks.
Best Wishes,
Stephen
An upholsterer by trade, but computers and websites are two of my passions
Composer version 1.7.3 2018-11-01 10:05:06
Using cPanel on a shared hosting account
cPanel Version: 82.0 (build 16)
Apache Version: 2.4.41
PHP Version: 7.2.22
MySQL Version: 10.3.18-MariaDB-log
Architecture: x86_64
Operating System: linux
Perl Version: 5.10.1
Kernel Version: 2.6.32-754.22.1.el6.x86_64
I am new here. I have a problem, I am trying to get the Composer PHP Dependency Manager to self-update and to perform the other tasks that it is designed to do. However, it is not working. I don't know much about this and I'm trying to figure this out. I'd appreciate any help that you can give. From an amateur's point of view, I think that there are some settings and/or files in cPanels/files that need to be fixed or corrected, etc. I think that at least part of the problem is getting "allow_url_fopen=0" set correctly in the php.ini file. I am trying to give as much detail as possible so that you can show me what the problem is or what I am doing wrong and what I should do to fix it.
Here is what I have been trying:
I am trying to get Composer working in my shared hosting cPanel account. Composer was installed a little over a year ago, but I haven't used it. I've only recently been trying to learn how to use it. Only I'm having problems with getting it to work and I think that problem have to be solved in cPanel first. After that I'll work on getting Composer working and learning it.
First, I'm trying to update composer to the lastest version. Using PuTTY, from within the cPanel files home directory I entered [~]# composer self-update. This was the error message that I received.
Code:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/versions" file could not be downloaded: allow_url_fopen must be enabled in
php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)
Code:
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
Path /home/username/php.ini PHP Version ea-php72
This is the text of the php.ini file that is in the cPanel Files home directory:
Code:
1 ; cPanel-generated php ini directives, do not edit
2 ; Manual editing of this file may result in unexpected behavior.
3 ; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
4 ; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
5
6 display_errors = On
7 display_startup_errors = Off
8 ignore_repeated_errors = 0
9 upload_tmp_dir = /home/winterss/php_temp
10 php_value_memory_limit = "128M"
11 max_execution_time = 30
12 max_input_time = 60
13 max_input_vars = 1000
14 memory_limit = 256M
15 post_max_size = 8M
16 session.gc_maxlifetime = 1440
17 session.save_path = "/var/cpanel/php/sessions/ea-php72"
18 upload_max_filesize = 2M
19 zlib.output_compression = On
20 allow_url_fopen = 0
21 ; I, Stephen, added this last line above this line
Code:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/versions" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configu
ration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)
Best Wishes,
Stephen
An upholsterer by trade, but computers and websites are two of my passions
Composer version 1.7.3 2018-11-01 10:05:06
Using cPanel on a shared hosting account
cPanel Version: 82.0 (build 16)
Apache Version: 2.4.41
PHP Version: 7.2.22
MySQL Version: 10.3.18-MariaDB-log
Architecture: x86_64
Operating System: linux
Perl Version: 5.10.1
Kernel Version: 2.6.32-754.22.1.el6.x86_64
Last edited: