-1

I have a problem in restoring my php.ini in the server. I was changing some line but I accidentally cut off and save.

Any idea how to restore it back?

Environment:

CentOS release 6.3 (Final) x86_64 PHP 5.3.17

ninjascorner
  • 121
  • 1
  • 4

2 Answers2

5

Restore from a backup.

Sorry, there's no magic sysadmin way to recover a file you deleted/saved over/set on fire/etc.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
  • Right but my bad that I dont have a backup. Is there any way I can get a default php.ini somewhere? – ninjascorner Oct 20 '12 at 01:23
  • 1
    @ninjascorner, if you don't have a backup you not only don't get any sympathy, you're also on the wrong site. This site is for IT professionals and professionals make sure they backup before changing things. – John Gardeniers Oct 20 '12 at 01:25
  • @ninjascorner you could do an install on another machine to try to get a "default" `php.ini` ... not that this is a good idea, mind you, but it's possible. – HopelessN00b Oct 20 '12 at 02:25
  • Yeah I just tried it now and it works..thanks man...I'm just learning in Unix and this will be my first lesson. Thank you for helping me even if I'm not a professional. Mistake is a key to become a better one I guess. – ninjascorner Oct 20 '12 at 04:45
  • Other locations exist for the default ini files: `/usr/share/doc/php5-common/examples/php.ini-development` `/usr/share/doc/php5-common/examples/php.ini-production` `/usr/share/php5/php.ini-production` `/usr/share/php5/php.ini-development` `/etc/php.ini.default` – StampyCode Sep 24 '15 at 14:11
  • @JohnGardeniers: I just logged in not only to flag your comment as unkind and useless; I also wanted to tell you you're an a$$h0l3 – mariano-daniel May 06 '23 at 03:39
1

You're out of luck as far as 'undeleting' it is concerned.

It's possible to restore one file from an RPM, see here for an example.

mdjnewman
  • 36
  • 4