Has anyone managed to install uploadprogess php extension on EA4?

cpsonia

Member
Oct 7, 2016
7
0
1
UK
cPanel Access Level
Root Administrator
I've manage to install uploadprogress for PHP 5.6. That was easy by just using PECL module installer in WHM.

However, this does not work for PHP7 and there isn't an official release.

The only version i found was: github.com/Jan-E/uploadprogress

So i tried installing it by:

Code:
1. cd /tmp
2. git clone [URL]https://github.com/Jan-E/uploadprogress.git[/URL]
3. cd uploadprogress
4. phpize
5. ./configure --with-php-config=/opt/cpanel/ea-php70/root/usr/bin/php-config --enable-uploadprogress
6. make
7. make install
Then, i added extension=uploadprogress.so to /opt/cpanel/ea-php70/root/etc/php.d/local.ini file and restarted Apache.

But it doesn't seem to work?

Anyone know what i'm missing?

Thanks,

Just to add, it seems uploadprogress is installed ok but PHP 7 isn't picking it up, even after restarting Apache?
 
Last edited by a moderator:

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
I did it using
  1. Login to WHM. Go to Home » Software » Module Installers
  2. For "PHP Pecl," click "Manage"
  3. Type "uploadprogress" into the "Install a PHP Pecl" box, click "Install Now"
 

cpsonia

Member
Oct 7, 2016
7
0
1
UK
cPanel Access Level
Root Administrator
Hi Albert,

Thanks for the help.

I tried that before but i get an error each time:

make: *** [uploadprogress.lo] Error 1
ERROR: `make' failed

It works for PHP 5.6 but when i switch to PHP 7 and try to install uploadprogress, that is when it fails.

I am trying to install it for PHP 7.
 

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
I see yes I get the same in php 7
make: *** [uploadprogress.lo] Error 1
ERROR: `make' failed

sorry about that but is should work this way
 

cpsonia

Member
Oct 7, 2016
7
0
1
UK
cPanel Access Level
Root Administrator
Code:
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/r/re2c-0.14.3-2.el7.x86_64.rpm

rpm -Uvh re2c-0.14.3-2.el7.x86_64.rpm
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello,

I'm happy to see it's now working well. Thank you for updating this thread with the outcome. Note the re2c package is also available through certain YUM repositories that will allow you to simply run:

Code:
yum install re2c
This is likely a better option compared to manually installing the RPM from another YUM repo.

Thank you.
 
Last edited:

cpsonia

Member
Oct 7, 2016
7
0
1
UK
cPanel Access Level
Root Administrator
Actually, that is what i tried before but for some reason it wasn't available in the repo. So i had to opt for manual installation.
Code:
# yum update
Loaded plugins: fastestmirror, tsflags, universal-hooks
EA4                                                      | 2.9 kB     00:00     
MariaDB100                                               | 2.9 kB     00:00     
base                                                     | 3.6 kB     00:00     
cpanel-plugins                                           | 2.9 kB     00:00     
extras                                                   | 3.4 kB     00:00     
updates                                                  | 3.4 kB     00:00     
Loading mirror speeds from cached hostfile
* EA4: 85.13.201.2
* base: mirrors.linode.com
* extras: mirrors.linode.com
* updates: mirrors.linode.com
Perhaps, there's a repo i'm missing?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello,

Here's an example YUM repo with this package on CentOS 7:

epel: fedora-epel.mirror.lstn.net

Note that use of the EPEL repo is currently unsupported.

Thank you.
 

cpsonia

Member
Oct 7, 2016
7
0
1
UK
cPanel Access Level
Root Administrator
Thanks for that. We understand we can add repos but were concern it'll start to mix and mess things up with differing file dependencies against cpanel or EA repos.

So we try not to include any external repos. Unless this isn't true and file dependencies with resolve itself?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Yes, that's correct. Third-party YUM repos are not supported, so in general it's good practice to only use the default YUM repo files for your OS.

Thank you.
 

joaoherberto

Registered
Jul 16, 2014
3
0
1
cPanel Access Level
Root Administrator
I cannot install uploadprogress for PHP7 also, I installed re2c as recommended above to no avail.

Here is the errors when it starts to compile:

Code:
config.status: executing libtool commands
running: make
/bin/sh /opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/pear-build-rootyiLf1K/uploadprogress-1.0.3.1/libtool --mode=compile cc  -I. -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress -DPHP_ATOM_INC -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/pear-build-rootyiLf1K/uploadprogress-1.0.3.1/include -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/pear-build-rootyiLf1K/uploadprogress-1.0.3.1/main -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress -I/opt/cpanel/ea-php70/root/usr/include/php -I/opt/cpanel/ea-php70/root/usr/include/php/main -I/opt/cpanel/ea-php70/root/usr/include/php/TSRM -I/opt/cpanel/ea-php70/root/usr/include/php/Zend -I/opt/cpanel/ea-php70/root/usr/include/php/ext -I/opt/cpanel/ea-php70/root/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c -o uploadprogress.lo
libtool: compile:  cc -I. -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress -DPHP_ATOM_INC -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/pear-build-rootyiLf1K/uploadprogress-1.0.3.1/include -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/pear-build-rootyiLf1K/uploadprogress-1.0.3.1/main -I/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress -I/opt/cpanel/ea-php70/root/usr/include/php -I/opt/cpanel/ea-php70/root/usr/include/php/main -I/opt/cpanel/ea-php70/root/usr/include/php/TSRM -I/opt/cpanel/ea-php70/root/usr/include/php/Zend -I/opt/cpanel/ea-php70/root/usr/include/php/ext -I/opt/cpanel/ea-php70/root/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c  -fPIC -DPIC -o .libs/uploadprogress.o
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c: In function 'uploadprogress_php_rfc1867_file':
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:160:31: error: 'ENFORCE_SAFE_MODE' undeclared (first use in this function)
                 int options = ENFORCE_SAFE_MODE;
                               ^
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:160:31: note: each undeclared identifier is reported only once for each function it appears in
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c: In function 'uploadprogress_file_php_get_info':
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:420:57: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
                 add_assoc_string( return_value, k, v, 1 );
                                                         ^
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:420:17: error: 'add_assoc_string' undeclared (first use in this function)
                 add_assoc_string( return_value, k, v, 1 );
                 ^
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c: In function 'uploadprogress_file_php_get_contents':
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:437:19: error: 'ENFORCE_SAFE_MODE' undeclared (first use in this function)
     int options = ENFORCE_SAFE_MODE;
                   ^
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:458:71: error: macro "php_stream_copy_to_mem" passed 4 arguments, but takes just 3
         if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
                                                                       ^
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:458:20: error: 'php_stream_copy_to_mem' undeclared (first use in this function)
         if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
                    ^
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:466:44: error: macro "RETVAL_STRINGL" passed 3 arguments, but takes just 2
             RETVAL_STRINGL(contents, len, 0);
                                            ^
/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/uploadprogress/uploadprogress.c:466:13: error: 'RETVAL_STRINGL' undeclared (first use in this function)
             RETVAL_STRINGL(contents, len, 0);
             ^
make: *** [uploadprogress.lo] Error 1
ERROR: `make' failed
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I cannot install uploadprogress for PHP7 also, I installed re2c as recommended above to no avail.
Could you verify the specific commands you ran for the entire installation process? I ran these commands on a test system and it works well:

Code:
mkdir /root/uploadprogress-tmp
cd /root/uploadprogress-tmp
git clone https://github.com/Jan-E/uploadprogress
cd uploadprogress/
/opt/cpanel/ea-php70/root/usr/bin/phpize
./configure --with-php-config=/opt/cpanel/ea-php70/root/usr/bin/php-config
make -j8
make -j8 install
echo "extension=uploadprogress.so" > /opt/cpanel/ea-php70/root/etc/php.d/30-uploadprogress.ini
Then, I ran the following command, with the output confirming it's installed as PHP extension for PHP 7.0:

Code:
# /opt/cpanel/ea-php70/root/usr/bin/php -m | grep uploadprogress
uploadprogress
Thank you.