I need to install this patch in my PHP code:
https://bugs.php.net/patch-display.php?bug_id=44522&patch=uploads_larger_than_2g_HEAD_v2&revision=latest
Can any body explain how?
My PHP Version : 5.4.10
You must have the source and patch file before you can patch it. Its quite simple.
patch -p0 < /path/to/patch.patch
If it shows an error, undo it by patch -R < /path/to/patch.patch
. and adjust the -p num value. and go to step 2. Here -p is the smallest prefix containing num leading slashes from each file name found in the patch file. A sequence of one or more adjacent slashes is counted as a single slash. This controls how file names found in the patch file are treated, in case you keep your files in a different directory than the person who sent out the patch. For example, supposing the file name in the patch file was
/u/howard/src/blurfl/blurfl.c
setting -p0
gives the entire file name unmodified, -p1
gives
u/howard/src/blurfl/blurfl.c
without the leading slash, -p4
gives
blurfl/blurfl.c
and not specifying -p
at all just gives you blurfl.c
. Whatever you end up with is looked for either in the current directory, or the directory specified by the -d
option.
The number after -p
can be determined by following
README.UNIX-BUILD-SYSTEM
file and for Windows use README.WIN32-BUILD-SYSTEM
file.Download your file as something like php_upload_larger_than_2g.patch
.
Place it on your system.
Run:
patch /path/to/patch/php_upload_larger_than_2g.patch /path/to/patching/file/whatever.php
This should 'patch' that file. Note this only works in Unix-like systems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With