By marknt15 on
Hi,
I am installing the memcache module (http://drupal.org/project/memcache) for drupal and I don't understand the meaning of:
"Apply the DRUPAL-5-cache-serialize.patch that comes with the module to your Drupal installation."
- What is the meaning of this? How will I apply the patch? I already installed the memcache module and I am stuck to this instruction.
Thanks in advance.
Mark
Comments
Refer to
Refer to http://drupal.org/patch/apply and look in the module somewhere for the .patch file.
Thanks for the quick reply.
Thanks for the quick reply. Anyway I tried this:
patch < DRUPAL-5-2-cache-serialize.patch
and it returned this:
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur includes/bootstrap.inc includes/bootstrap.inc
|--- includes/bootstrap.inc 2007-07-26 12:16:45.000000000 -0700
|+++ includes/bootstrap.inc 2008-01-29 13:56:54.000000000 -0800
--------------------------
File to patch:
What is the file to patch?
Thanks again.
...
there is a mismatch between where the patch file is and where the file to be patched is, so the command won't work. to solve you either need to change location of the patch file and/or change the form of the command to sync them up.
perhaps you can get some ideas from this page on how to apply a module patch: http://drupal.org/node/620014
Note that you can also just
Note that you can also just type in the location of the file at the prompt:
/PATH/TO/SITE/includes/bootstrap.inc
Ezra Wolfe
DLC Solutions
EthosCE
Note the instructions for
Note the instructions for applying patches. You should place the patch in your Drupal root directory and use:
Hi rszrama, I tried your
Hi rszrama,
I tried your instructions. I pasted the patch DRUPAL-5-2-cache-serialize.patch in my drupal root directory and I entered this:
patch -p0 < DRUPAL-5-2-cache-serialize.patchand it returned this message:
Most of it failed. How can I fix the failed processes?
Are you patching against
Are you patching against Drupal 5? If not, I am pretty sure you don't need that patch. If you are, the patch is version specific, so that one would only work with 5-2, which might be the problem.
If you look a the D5 README.txt for the memcache module, it tells you to install the patch. For the D6 version of the module, there is mention of it.
http://drupalcode.org/viewvc/drupal/contributions/modules/memcache/READM...
Ezra Wolfe
DLC Solutions
EthosCE
Thanks for your reply ezra but there's still an error
I am patching a drupal 5.2 project but it still yields an error. The patch I used is DRUPAL-5-2-cache-serialize.patch.
My OS is Snow Leopard 10.6.2 and I have followed this tutorial: http://drupal.org/node/60818
My pwd is:
Then i entered the patch syntax and here is the error message:
Not a mac guy
I'm not a mac guy but everything looks right to me. Maybe someone else can chime in on any mac-specific issues?
Just another thought -- are you using 5.20 or 5.2?
Ezra Wolfe
DLC Solutions
EthosCE
...
I am not a Mac guy either, but this is a Linux command, so it shouldn't matter what OS is. (I'm not a Linux guy either, but I'm 99% sure that is true).
The error continues to say that you are not in the right place to be running the command as you have. You can see that it is trying to patch various files that are presumably not the right files: "patching file bootstrap.inc" "patching file menu.inc". It can't find the right lead in code in those files, so generates teh hunk fails.
We can't see the path you need to follow, but what you called pwd is supposed to be the path, then that looks wrong.
/Applications/MAMP/htdocs/cec/includes. Presumably the right path ends with.../memcache(assuming that's the module folder name).Key is: you must have the patch file and the file to be patched in the same folder - meaning they should both be in the memcache module folder.
Then the command should be:
$ patch < DRUPAL-5-2-cache-serialize.patch. Note the Linux is case-sensitive, so you must type it exactly as it exists on the system.This is the same for Windows or Mac and is described on this page marknt15 pointed to earlier: http://drupal.org/node/60818. See para that starts: "Using the 'cd' command..."
So basically, you just take the patch file and put it in the module folder - the same folder where the file to be patched is located.
Then you navigate via cd command to be in that same folder. then you run the command
$ patch < DRUPAL-5-2-cache-serialize.patch.To be sure you are in the right place, us 'ls' command to list files. If 'ls' doesn't list the files in module folder, you are in wrong place and command won't work. Don't run the command until the file list is the correct one.
All the commands / details for doing this navigation as described in detail on this page: http://drupal.org/node/620014 that I pointed to earlier. The commands listed for cygwin should be the same as the ones you would use since this is not operating system specific, but you are using a specialized tool that emulates Linux on Mac same as Cygwin is doing on Windows.
Hope that helps.
Sorry for the late reply
Sorry for the late reply John. I tried what you said "So basically, you just take the patch file and put it in the module folder - the same folder where the file to be patched is located."
I copy pasted the 'DRUPAL-5-2-cache-serialize.patch' patch in:
Then I entered this(my pwd is /Applications/MAMP/htdocs/cec/sites/all/modules/memcache):
And got this:
I think it is still wrong. What seems to be the problem? Thanks again.
...
yes, we are in the same place as with your 2nd post, so no progress has been made.
i finally looked at the actual patch file. it is more complicated than most patches i have seen (which, to be honest, isn't more than a dozen or so).
it appears to include patches to multiple files vs. just a single file. and some of these files do not appear to be in the memcache directory. i have no experience with this type of patch and can't offer any further advice how to make it work.
i think the best thing is to post a question on the memcahce issue queue. i think you need to get advice from people that know this module in detail and how it interacts with other pieces of drupal.
Yes the patch appears to
Yes the patch appears to include multiple files. I created a new drupal 5.2 and installed the memcached module and this is the screenshot:
http://i.imgur.com/NjwxG.jpg
I think it worked even though I had trouble in the patches. I just don't know if it will generate an error because of the problems I encountered in the patching.
My another question is I don't know how to use it. Will it work as is after the installation with no additional code required or do I need to add some code in my select statements in order for it to work?
By the way, I followed the installation.txt. I added a memcached process and edited my settings.php and added this:
A quick workaround would be
A quick workaround would be to Just type in the path manually when it asks "File to patch:"
Ezra Wolfe
DLC Solutions
EthosCE
I typed the absolute path
I typed the absolute path manually plus the filename like
but it generated an error:
The file you are patching
The file you are patching (bootstrap.inc ) has either already been patched, or is a different version of the file than the patch expects.
I'd recommend you compare the patch with the file and see if it's already been patched or just get a clean version of that file and repatch it.
Ezra Wolfe
DLC Solutions
EthosCE