The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ive lost my php.ini

Discussion in 'General Discussion' started by Chriz1977, Oct 21, 2009.

  1. Chriz1977

    Chriz1977 Well-Known Member

    Joined:
    Sep 18, 2006
    Messages:
    191
    Likes Received:
    0
    Trophy Points:
    16
    Hi

    I was editing my php.ini earlier and something happened that reduced the file size to 0. Ive tried to backup from an old copy but now im getting a 500 internal server error. Anyone got any ideas if i might have backed up from a copy that isnt too recent. Is there a normal place for php to make a backup of its ini?

    Cheers
    Chriz
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    You have several options ...

    1. Rebuild your PHP configuration

    2. Rebuild PHP itself (/scripts/EasyApache | Manual Compile)

    3. Download latest PHP config from PHP.NET site

    4. Copy PHP.INI from Cpanel's copy of PHP also running on your server
    to /usr/local/lib and make any necessary adjustments.
    (locate php.ini)

    5. Download PHP source and just copy PHP.INI template out of that

    Any way you cut it though, it is fairly simple to get your PHP configuration back and it's a simple matter of updating settings.
     
  3. Chriz1977

    Chriz1977 Well-Known Member

    Joined:
    Sep 18, 2006
    Messages:
    191
    Likes Received:
    0
    Trophy Points:
    16
    Its the one in /usr/local/lib that i lost. Is that the cpanel one as its working ok?
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    To regenerate a new php.ini file, I would move the existing (empty or incomplete) file out of the way, renaming it if needed.

    Then, run EasyApache, following through to build completion; this will generate a fresh php.ini file.

    Here is the command to run EasyApache via root SSH access:
    Code:
    # /scripts/easyapache
    Here is the menu path to run EasyApache via your root WHM control panel:
    WHM: Main >> Software >> EasyApache (Apache Update)

    Immediately following the build completion, I recommend saving a custom backup of the php.ini file in case it is needed later to revert back to (e.g., after editing or for testing).
    Code:
    # cp -pv /usr/local/lib/php.ini /usr/local/lib/php.ini.backup
     
  5. agressor

    agressor Active Member

    Joined:
    May 15, 2005
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
  6. aspardeshi

    aspardeshi Member

    Joined:
    Oct 22, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    change file permissions of php.ini

    try changing file permission for php.ini. it worked for me some time long ago. :)
     
Loading...

Share This Page