Problem/Motivation
The D7 and D8 status report still recommends installing PECL uploadprogress library (http://pecl.php.net/package/uploadprogress) and shows a warning if not working. The installation process doesn't work for PHP 7 the same way like often recommended in the documentations for PHP 5 before and pecl uploadprogress seems effectively almost deprecated. This can confuse the user. There is a Drupal issue on support for PHP 7 (https://www.drupal.org/node/2454439) which was marked fixed without addressing the uploadprogress that was mentioned in the comments of the mentioned issue.
At a minimum, the status report in the users Drupal admin/reports/status path should be changed to wether not recommend PECL uploadprogress no more or to link to a new way of installing it like suggested in the comments here below.
Alternatively, we could have a second approach whether that be APC (also currently mentioned on the status report) or something else.
Debian 9 and Ubuntu 16.04 or higher now ship with PHP7 by default and php meta packages link now to php7 not to php5 (as has been mentioned in other issues) so this is about to become more important and it would be nice to get ahead of the curve if possible.
Some mentioned temporary work arounds in the comments below: Ubuntu: #2, #7, Centos: #20, Debian/ubuntu: #26, #55, #32.
Steps to reproduce
Proposed resolution
Link to the project on github, https://github.com/php/pecl-php-uploadprogress#uploadprogress"
Remaining tasks
Review
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-2718253
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2718253-uploadprogress-pecl-documentation
changes, plain diff MR !11336
Comments
Comment #2
soulsymphonies commentedHi,
I found a way to install the PECL uploadprogress library on Ubuntu 16.04 with PHP 7.0.4.
Actually there is a Git Repository on GitHub with a PHP7 compatible version of the PECL uploadprogress library
(https://github.com/Jan-E/uploadprogress)
The following prerequisites are required:
The following packages must be installed for this solution to work:
Of course Apache2 and PHP7.0 and their dependencies and also these extra packages:
php7.0-devincludes thephpizecommand and all else required to compile the modulegitrequired for the cloning of the source from GitHubnanoor any other text editorIf necessary all these packages can be installed via
sudo apt-get install php7.0-dev git nanoHere is my solution:
cd ~for the home directorygit clone https://github.com/Jan-E/uploadprogressinto your chosen foldercd uploadprogressphpize./configuremakesudo make installThe "sudo" on the last command is required, because the
make installcommand will store the module in PHP include directory (which in my case was/usr/lib/php/20151012) , which requires elevated permissionsuploadprogress.inifile in the/etc/php/7.0/mods-availabledirectory so Ubuntu can find the newly compiled module, you can do this via this command, again you need elevated privileges, so "sudo" is required:sudo touch /etc/php/7.0/mods-available/uploadprogress.inisudo nano /etc/php/7.0/mods-available/uploadprogress.iniThese are the file contents:
sudo phpenmod uploadprogresssudo service apache2 restartI hope this works for you, for me it did, now the uploadprogress module 1.0.3.1 is running via PHP7 on Ubuntu 16.04 (I have added an excerpt from phpinfo() as a jpg)
Kindest regards,
Robert Christian
Comment #3
carteriii commentedFirst, thank you for this. Your work to figure this out and your detail in this post is AWESOME. Thank you.
For the core developers of D8, I do think this might be too much to recommend to the average user. At a minimum the simple status report suggestion to use PECL should still be changed to either reference this sequence of steps or something similar. It would obviously be nice if that PHP7 version/repo could be merged back into the main PECL source to be officially supported & distributed, but that may be more than anyone here wants to do or own.
Comment #4
bradjones1APCu is available for PHP 7 but doesn't appear to be picking up any of the Upload Progress-related INI configuration options. In fact it doesn't look as though they are supported, since there are no default values shown in the phpinfo() page, attached.
I agree the message should probably not recommend Uploadprogress (it appears to be pretty much abandoned, that GitHub project, aside...) but it appears Upload Progress is pretty much not an option with APCu, either?
Comment #5
bradjones1Comment #6
bradjones1Comment #7
soulsymphonies commentedI also found a PPA for Ubunutu
(https://launchpad.net/~ondrej/+archive/ubuntu/php/+index?batch=75&direct...)
With this PPA the installation of the upload progressbar for PHP 7 should work also.
add-apt-repository ppa:ondrej/phpFollowed up by this command
sudo apt-get updateThen the uploadprogress for PHP7 can be installed via:
apt-get install php-uploadprogressShould also work when I recall it right from my memory from some weeks ago as I figured out the outer solution, hope it helps, but I can't test it again at the moment, as my linux virtual machine is not avaible to test right now.
Comment #8
carteriii commentedThank you! That works great!
For others who try this, I believe you must do a
sudo apt-get updateafter installing the repository and before installing the package.
Then remember to restart your web server or else Drupal won't see & report its presence. I think this issue should still remain open to change the suggestion on the status report, but this seems to work perfectly.
Do you know if adding that repository is going to result in me getting PHP updates other than just for the uploadprogress? I can see that being good or bad to get core PHP updates outside the normal Ubuntu/Canonical repos.
Comment #9
soulsymphonies commentedthank you for the information about the missing command, I have updated my comment.
regarding the PHP main version updates:
yes, this PPA also includes the stable main release updates of PHP7, which is a good thing, as you will get the newest security updates
This package is maintained by ondrej from the Debian team, so I consider it a trustworthy source for these updates.
Comment #10
nickdickinsonwildeMore than anything this is a documentation failure.
As shown by the various methods noted above it is easy to install/setup PHP UploadProgress.
So the obvious fix is to update the documentation. I have written clear succinct instructions in a new book page; if anyone finds them unclear please edit or comment.
Comment #11
bradjones1I disagree with closing this, though I'll agree with the documentation tag. The software should not be recommending actions on the part of a user (who is not necessarily a technical expert) that are not possible for a particular version of PHP. I'm not suggesting Drupal need buy in to a particular solution over another, but documentation on d.o. is no replacement for an appropriate warning message in the code itself, IMHO.
Comment #12
nickdickinsonwildeAs I detailed in that documentation, any (modern) PHP version is (relatively) easy to install Upload Progress for at least with Debian based distros; What do yo mean by "that are not possible for a particular version of PHP"?
Comment #14
adamps commentedI believe this thread applies equally for anyone investigating upgrade to PHP7 with D7, so I have adjusted the title.
I agree that it's best not to close the issue yet.
In the long term, if the maintainers of uploadprogress have become inactive, then perhaps Drupal needs to consider strategy. If there is no satisfactory alternative, then maybe it could be adopted into core as part of the vendor directory?
Comment #15
toomanypets commentedSee related issue #1561866: Add support for built-in PHP session upload progress.
Comment #16
cherabomb commentedI managed to get the uploadProgress component (adjusted for PHP7 by Jan-E) installed on a shared host (1&1) today, where console access to the PHP binaries is restricted. The trick is to compile the component for PHP7 using a PHP script. Here's the PHP script, which will need executing from a web browser:
And here's the content of mymakescript.sh:
Once the first bit of the script runs, follow the instructions to edit the Makefile generated, then comment out the lines that already ran using ## and uncomment the make line. If you don't see a Makefile after the first bit ran, then something went wrong - check permissions and paths.
Comment #17
oriol_e9gWe can discuss about the uploadprogress install but in PHP 7 the system message it's not correct, it's saying:
Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (preferred) or to install APC.In PHP7 you can install APCu (not APC) but APCu not seems that have any Upload Progress features. Is it possible to enable apc.rfc1867 with APCu in PHP7?
Comment #18
adamps commentedAnother source of the code for PHP7 is the "master" code of the official PECL repository http://git.php.net/?p=pecl/php/uploadprogress.git. You can build this the same way as #2, just start with git clone https://git.php.net/repository/pecl/php/uploadprogress.git.
It would be a big help if we could persuade the maintainers for https://pecl.php.net/package/uploadprogress to tag a new release on the current master code - at which point this issue would mostly go away.
As far as I can see, the code at https://github.com/Jan-E/uploadprogress is one commit behind both ppa:ondrej/php and the PECL master.
Comment #19
Andru commentedUsing the git source in #18 I was able to install this on Dreamhost shared hosting using PHP 7 - I had uploaded a site that was already using it in PHP 7 on Ubuntu 16.04 locally, thanks to the instructions at https://www.drupal.org/node/2754637
There is already a whole other discussion here about installing on shared hosting in PHP 5 https://www.drupal.org/node/1074160#comment-10663866 - I've added there the steps I took in PHP 7.
I agree the documentation could be better.
Comment #20
konfuzed commentedConsolidating #18 and #19 for PHP7 on RHEL 7 / CentOS here were my steps (as root, use sudo and change paths where necessary)
# cd ~/
# git clone https://git.php.net/repository/pecl/php/uploadprogress.git
# cd uploadprogress
# /usr/bin/phpize
# ./configure
# make
# make install
# vi /etc/php.d/20-uploadprogress.so
; Enable Upload Progress
extension=uploadprogress.so
# apachectl -t
# apachectl restart
Comment #21
anavarreI essentially solved it the same way as in #20 but for Debian - https://github.com/anavarre/drucker/blob/master/orchestration/playbooks/...
Comment #22
oriol_e9gOK. It's possible to install uploadprogress with PHP 7 but PHP7 doesn't suport APC rfc1867... so, we need to update the error message according to the reality.
Comment #23
oriol_e9gMisspelling and for 8.3.x branch because includes a new sting.
Comment #24
gappleThis recent github issue mentions that rfc1867 support was not included in APCu 5
https://github.com/krakjoe/apcu/issues/212
Comment #25
gappleGiven that neither uploadprogress or APCu support is available for PHP 7 (and doesn't look likely in the future), I suggest only providing the status entry for PHP 5.
#1561866: Add support for built-in PHP session upload progress could replace uploadprogress and APCu in Drupal 8 for all versions of PHP, and provide the status message based on its relevant config value.
Comment #26
nickdickinsonwilde@gapple: uploadprogress with PHP7 is available and does work (at least on nix based systems - haven't tested on Windows) - on Ubuntu/Debian apt-get php-uploadprogress (then add `extension=uploadprogress.so` to your php.ini).
@oriol_e9g's I like your patch in #23, really is an improvement +1. Only wonder is about adding a link to the D.O documentation for it?
Comment #27
alexpottThis change was wrong. My mistake because I committed #2617568: Rename apc_* functions with apcu_*. APCu doesn't support rfc1867 :( Which makes all of this advice wrong. Imo since Drupal 8 supports PHP 5.5 and up we should drop all mention of APC here. We shouldn't be advising people to install it ever. I think we should also file a followup to discuss changing file_progress_implementation() to not check APC either but that might be a BC break so let's not do that here.
Comment #28
alexpottHere's what I would recommend doing in this issue. And then we open a followup to determine if
file_progress_implementation()should ever returnapceven in PHP5 for Drupal 8.Comment #29
alexpottAlso I think that this is a bug against the file module - because
file_progress_implementation()should never return apc in PHP7.Comment #30
gappleLooked at uploadprogress availability further
Comment #31
oriol_e9g@alexpott with your patch, in a system with PHP5 and without APC you never recommend install APC as a possible solution... and if you install APC, then the system says that you can enable rfc1867. I think that it's better offer always two options for PHP5 and only one for PHP7.
@gapple it's possible install uploadprogress in PHP 7 and works. You cannot install via pecl but it's still possible from git and from ppa repository, see first messages in this issue.
Comment #32
Hawkney commented#URL to get development environment working
http://packaging.ubuntu.com/html/packaging-new-software.html
#Procedure:
sudo su
cd ~user
mkdir compile
cd compile
mkdir uploadprogress
cd uploadprogress
#Not compatible with php 7.0
site : http://pecl.php.net/package/uploadprogress
#Compatible with php 7.0
site: https://github.com/Jan-E/uploadprogress
download the zip file
mv ~your-user-name/Downloads/uploadprogress-master.zip .
apt-get install unzip
unzip uploadprogress-master.zip
ls
cd uploadprogress-master
sudo apt-get install php-dev php-pear
phpize
./configure
make
make test
sudo make install
vi /etc/php/7.0/mods-available/uploadprogress.ini
file should be empty
press i to insert
paste following code:
----------------------------------------------------------
; configuration for php uploadprogress module
; priority=20
extension=uploadprogress.so
----------------------------------------------------------
esc :wq! enter
sudo phpenmod uploadprogress
sudo service apache2 restart
drupal link to check
?siteroot?/#overlay=admin/reports/status
Comment #33
oriol_e9gWhat do you think about this version? The same solution as @alexpot but now, when there is not implementation recomends uploadprogress or APC for PHP 5 and only uploadprogress for PHP 7.
Comment #34
alexpott@oriol_e9g the thing is we shouldn't be recommending APC for PHP5.5 and up either. Hence in #27
This is because PHP from 5.5 comes with opcache - and having both opcache and APC is very messy.
Comment #35
alexpottWith #28 APC will still work on PHP5.5 and 5.6 we just don't recommend it - so it you want to be esoteric you can be but let's not recommend it as a solution.
Comment #36
oriol_e9gOK. Go with #28
I think that, in theory, I cannot put the RTBC but the @alexpott implementation is different than mine.
Comment #37
tstoecklerRe-uploading patch from #28 to make it more clear for committers and the testbot.
Comment #39
xjmThanks @tstoeckler for adding the correct patch at the end.
I had to spend a lot of time reading this issue to understand why this hunk was being removed entirely, instead of just removing the second sentence. I see in #27 @alexpott implies it was added as a mistake and is a bug in its own right, but it blurs the scope a bit. A clear issue summary would have helped this patch be committed with only a few minutes of review rather than an hour.
Committed and pushed to 8.3.x. Thanks! I'm trying to decide also whether it makes sense to backport this change, so leaving RTBC against 8.2.x for the moment.
Comment #40
xjmComment #42
xjm@cilefen pointed out that the last hunk still results in the library being recommended on PHP 7.
Let's create a separate issue for "Don't recommend APC", and maybe postpone it on this one. This one has a lot of research about the library that should not be lost and that still needs followup.
Comment #43
alexpottImo we should probably still recommend the library in PHP7 or work out what and if there are other alternatives out there. See #18 that points out PHP7 support is in the PECL git repo.
Created #2836434: We should not ever recommend APC in Drupal 8 and postponing this issue on that one
Comment #44
xjmAlright, #2836434: We should not ever recommend APC in Drupal 8 is in now. Thanks everyone!
So now, we need to go back to "Active" here, and we can use all the information on this issue to further explore what change to make (if any) regarding the recommended library, now that we no longer recommend APC at all. I still definitely recommend rewriting the issue summary to include the discussion, workarounds, testing etc. so far.
Comment #45
xjmComment #46
xjmComment #48
xjmAdding credit for @cilefen for realizing the fix in this issue wasn't making the change I thought it was.
Comment #49
Hawkney commentedThe Upload progress status report should simply reference a drupal.org help/resolve page with instructions for resolving this issue. Resolve will depend on user-specific configuration and preference.
On the drupal reference page, point users to http://pecl.php.net/package/uploadprogress for dated PHP versions and point users to https://github.com/Jan-E/uploadprogress for PHP7 compatibility(for example).
The drupal.org upload progress reference page can cover solutions for various versions and configurations of drupal.
Updated repositories and resolution methods for PECL uploadprogress as well as APC solutions can be referenced on the drupal.org upload progress page by the drupal community.
At present, users are simply redirected to a dated repository with no instructions on how to easily resolve the upload progress status issue.
Comment #50
alexpott@Hawkney that sounds like a great idea - and easier for us to maintain and keep updated with current knowledge - where do you think this page should be located?
Comment #51
Hawkney commentedI tested https://www.drupal.org/uploadprogress and no page is found here. Perhaps a page similar to this could be used.
Comment #52
alexpottI can't add pages but a sub page of https://www.drupal.org/docs/8/core/modules/file ie. https://www.drupal.org/docs/8/core/modules/file/upload_progress would make sense to me.
Comment #53
Hawkney commentedhttps://www.drupal.org/docs/8/core/modules/file/upload_progress
should work fine. Let me know if/when the link is created, I can post some info on resolving the upload progress status issue on Ubuntu with PHP7.0
Comment #54
drummThe https://www.drupal.org/docs/8/core/modules/file guide could use a maintainer. If you or anyone else has an ongoing interest in this, see the “This guide needs maintainers.” block toward the bottom of the sidebar.
Below that, (I think) all confirmed users should see an add Documentation page link. New documentation pages get paths based on their parent guide & title, if it is titled “Upload progress”, you’ll get …/docs/8/core/modules/file/upload-progress automatically. New pages do need a guide maintainer to review the page and add it to the guide’s menu.
Comment #55
jonathan.green commentedI made a PPA here for Ubuntu 16.04. It just contains a package for upload-progress. Didn't like the other PPA linked because it contains a lot of other PHP packages that I didn't necessarily want to install on my server.
https://launchpad.net/~lyrasis/+archive/ubuntu/php7-uploadprogress
Comment #56
Hawkney commentedI found an existing page that the status report could point to, the page already has info on installing PECL uploadprogress.
https://www.drupal.org/node/793264
Perhaps a link from the status report to this reference would be an option.
Comment #57
alexpott@Hawkney well that page is currently located in CCK / Filefield - very Drupal 6 :)
Comment #61
develcuy commenteduploadprogress is the old way, there is an on-going effort for supporting client-side upload progress: #2833968: Upload progress using jQuery.form plugin instead of 3rd party PHP libraries, less hassle IMHO.
Comment #62
dqdAs long as the main issue still appears for users running stable Drupal versions atm, this issue should not be closed, because it is creating the impression looking on the wrong place for a solution. But as long as other solutions still do not work or are not ready yet, the proposed work arounds in this issue here can be an option for the user. Otherwise he runs into the "unfixable Drupal issue" loop, as so often ...
If somebody want to suppport and contribute the ongoing work on a long term solution, please follow the links above to the other issues disussing alternatives. But please do not close this issue yet.
I've updated the issue summary to reflect the discussion and the temporary work arounds including links and related issues.
@#10 Your new book page is more than irritating and makes the situation even more confuse. There are already many different book pages about this topic around and which all fail atm. Please let us merge them to prevent confusion and clutter.
Comment #63
dqdComment #65
drupalchille commentedIt worked for me. Thanks!!!
Comment #66
nara117 commentedI'm using CentOS Linux release 7.4.1708 (Core) with php 7.1 and Drupal 7 and it doesn't work.
Does anyone has a solution ?
Thanks!
Marin
Comment #68
nancydruAFAIC we can totally delete that message.
Comment #69
quicksketchI found today that Ubuntu 18.04 supports the PHP 7.2 + uploadprogress combination without any additional PPAs. It's as simple as:
Then uploadprogress shows up, Drupal identifies it, and everything works fine.
So it looks like uploadprogress isn't entirely abandoned. At least someone in the Debian/Ubuntu upstreams must have updated it. It may be possible to compile for other distributions from their repository, but I haven't attempted that: https://packages.debian.org/source/stretch/php-uploadprogress
Comment #70
hass commented#69: Same works for Debian 8 and PHP 7!
Comment #72
francewhoa@quicksketch and hass :) Thanks for your contribution. This is to confirm #69 works with Debian 9 Stretch with PHP 7.
@All :) Today I contributed this new documentation. For newcomers installing uploadprogress on Debian 9 Stretch with PHP 7.
For those facing a challenge with uploadprogress somehow not working. As an alternative, you might be interested to consider File Resumable Upload (file_resup) Drupal module. See this screenshot. Some of its benefits are:
Read more.
Comment #73
darren ohComment #74
andypostFiled https://github.com/php/pecl-php-uploadprogress/pull/3 to request 7.x only compatible release
Comment #75
andypostAs of today released https://github.com/php/pecl-php-uploadprogress/releases/tag/uploadprogre...
Comment #76
andypostAlso the uploadprogress extension docs upgraded https://github.com/php/pecl-php-uploadprogress/blob/master/README.md#doc...
Comment #77
jshimota01 commentedFor gods sake - remove this from the report! 4 yrs this has been there and it sticks in my craw. As I posted elsewhere:
It's insane this problem still exists. Here we are on D8- nearly d9 and I still have a warning message from this basically defunct thing. How it got there in the first place is really the problem imho. (I'm certain it got added by an overzealous person involved in it's creation but I can't prove it)
Regardless - searches for help lead you to broken links on the windows page. PHP now has both 32 and 64 bit flavors, there are 11 different VC libraries. Why does a PHP module get checked on a drupal website??! Someone PLEASE yank this check off the damn report page. If a user wants it they can go look for it. The link on this page goes to old code, there is misleading info that php 7 is not supported in multiple places.. (The module HAS support for php 7 IF you can somehow guess correctly the proper dll to acquire) Regardless of all this - It does NOT belong on the status page. There are a ton of other modules for php, but I don't get a status of them... why this one!!!! APC? APCu? there not on the report. etc. etc.
Comment #79
timothy.siford commentedThere are a number of Drupal.org comments that insist that PECL uploadprogress is no longer needed for upload progress. In fact, you'll even see official comments such as "You don't need PECL uploadprogress any more. Your Drupal site will show upload progress just fine without it. Just ignore the warning. Hopefully, somebody will remove this outdated warning from Drupal core."
All of that said, for the most part, you *DO* want to install PECL uploadprogress if you want to keep things super simple and have a pretty upload progress 'bar' and not the built in 'throbber'. Don't let other comments on Drupal.org lead you down the path of not installing PECL uploadprogress. Just install it and you will reap the benefits from it. Here's my situation and what you will want to do.
Drupal 8.9.2. Status report (at the bottom) shows: "UPLOAD PROGRESS Not Enabled". Given the version that I am on, they got rid of the recommendation to install PECL UploadProgress or APC. But, follow along to install it and make your life easy.
PECL UploadProgress went almost a decade without updates. This is why people on the forums were talking bad about it. There was no support for PHP 7.0+. HOWEVER, there is definitely support as of January of 2020 for PHP 7+. No worries there.
To install PECL UploadProgress on Ubuntu 18.04 LTS, all that was needed from my end is to install the package and restart apache. The command is as simple as "sudo apt install php-uploadprogress". My distribution automagically enabled it too by placing 20-uploadprogress.ini into the current php apache folder.
After restarting apache, the status report will now immediately show "UPLOAD PROGRESS Enabled (PECL uploadprogress)"
Hooray! Now it is enabled. If you're wondering how to swap away from the rotating 'throbber' to the 'bar', follow along.
By default, when you don't have PECL uploadprogress installed, a file field on a content type will default to 'throbber'. There is no option to change away from this to the "bar with progress meter" until you install the PECL library. However, after installing the library, you will now magically get the other option :). Edit the content type that has your file field and go to "Manage Form Display". Find your file field and edit the options for this (click the cog wheel). You will now see "Bar with progress meter". Select that option. Click Update. Now scroll to the bottom and click Save. Don't forget to click save. Clear the cache. Done. Now when you go to upload you will magically have a file upload progress bar and not a 'throbber'. It all works out of the box so long as PECL Upload Progress library is installed.
It's amazing that there isn't any documentation on this. I debugged the PHP using VSCode (Xdebug) searching for key elements used by the PECL library in order to figure it out. I hope this helps someone because I know I could have used this type of advice before today.
Comment #80
andypostJust today updated PR for 2.0 release of uploadprogress to make it compatible with current PHP 8
It also adds type definition for extension's functions, so code could use static analysis more efficient
Comment #83
timefor commentedAfter many hours --- Got uploadprogress 1.1.3 working running on Amazon Linux AMI 2, PHP 7.4, Drupal 9.2, only after applying a patch (https://github.com/php/pecl-php-uploadprogress/pull/9) and compiling the extension myself.
Without the patch I was seeing "segmentation fault" error and 502 bad gateway. Hope this helps somebody.
Comment #84
andypostnew release https://pecl.php.net/package-changelog.php?package=uploadprogress&releas...
same time it's compatible with PHP 8.1
Comment #85
andypostThere's a updated docs and examples for 2.0.1 https://github.com/php/pecl-php-uploadprogress/commit/a88b5726feb2cba073...
It points how to use it with nginx/php-fpm/caddy
Comment #92
quietone commentedUpdated IS, made an MR with the suggestion.
Comment #93
kim.pepperReviewed and confirmed the links are correct.
Comment #95
catchCommitted/pushed to 11.x, thanks!
Did my best with issue credit but there are a lot of comments from a lot of different people on this issue so apologies if I overlooked someone.