• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

Help me patch this php file

In Drupal I get the error message as explained here, so I suppose I must use this patch: http://pear.php.net/bugs/bug.php?id=18129
I know how to use Putty to get to this file, but then what?
0
TheoRichel
Asked:
TheoRichel
  • 7
  • 6
1 Solution
 
pmasottaCommented:
create the patch on the same directorry of the file you want to patch
#cd <to desire directory>
# nano

copy&paste the patch text from the web page to putty
[ctr-x] to exit
save giving a name as file.patch


then run the patch command
# patch < file.patch
0
 
TheoRichelAuthor Commented:
Thanks
I have opened nano
I copy the piece starting with ----IMC.php to EOF

Then go to Putty, but Ctrl V doesnt work
0
 
pmasottaCommented:
to paste on nano using putty just holding pressed SHIFT click the mouse rigth button
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
TheoRichelAuthor Commented:
"Only garbage was found in the patch input"
0
 
pmasottaCommented:
the patch should beggins with

--- IMC.php
+++ (clipboard)
@@ -134,9 +134,16 @@
      * @return boolean
      */
     public static function autoload($className)
-    {
-        return require str_replace('_', '/', $className) . '.php';
-    }


do not past the first text lines...
0
 
TheoRichelAuthor Commented:
Yes, it does, but when I paste it all formatting is gone, so I have to put it back manually
0
 
TheoRichelAuthor Commented:
patch: **** malformed patch at line 15: $className).'.php';


do not understand, just copied it like that
0
 
pmasottaCommented:
the formatting shouldn't be gone...
I just cut and pasted the text on nano using ubuntu and the format is kept...

from now on the problem could be the patch but this is the way to apply a patch ;-)
0
 
TheoRichelAuthor Commented:
Sure I now learned how to apply a patch. But this is not Ubuntu by the way, but Centos .5.

And I am sorry, but the formatting just disappears when I copy this from Firefox to Putty ( and to Notepad as well)

And I have accepted this problem and am now struggling line by line to correct it, but I do not know what went wrong in line 15
0
 
pmasottaCommented:
ok do this

# wget http://pear.php.net/bugs/bug.php?id=18129
that brings the patch web page

the patch inside the file keeps the format, rename the recived file, edit it getting rid ov everithing but the formatted pach save it and apply the patch ;-)))
0
 
TheoRichelAuthor Commented:
OK I will try that. Is it a problem that I am on PHP 5.2.16 and that this patch is for php 5.3.3?
0
 
pmasottaCommented:
yes.
a patch really works on the exact version that is supposed to fix...
A patch gives to the patching engine the file, the location, lines to erase(-), lines to add(+)
applying a patch on a different version== problems...
0
 
TheoRichelAuthor Commented:
OK then it stops here. Thanks for your time and the patching skills, they will be of use in another situation.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now