Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member Chriz1977's Avatar
    Join Date
    Sep 2006
    Posts
    191

    Default Ive lost my php.ini

    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
    When I was young I used to break Windows, Now Microsoft does it for me!

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    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. #3
    Member Chriz1977's Avatar
    Join Date
    Sep 2006
    Posts
    191

    Default

    Its the one in /usr/local/lib that i lost. Is that the cpanel one as its working ok?
    When I was young I used to break Windows, Now Microsoft does it for me!

  4. #4
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    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. #5
    Member
    Join Date
    May 2005
    Posts
    34

    Default

    if u lost ur php.ini try to run /scripts/phpini

    btw, if u have modules installed for php, u can recompile it, via /scripts/easyapache or via web

    http://URIP:2086/cgi/easyapache.pl?a...el_sync_screen


    cheers
    Francisco.-

  6. #6
    Member
    Join Date
    Oct 2009
    Posts
    15

    Default change file permissions of php.ini

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

Similar Threads & Tags
Similar threads

  1. Individual php.ini files for PHP FCGI and PHP CGI
    By Miraenda in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-22-2011, 09:55 AM
  2. php.ini and override default php.ini
    By areh in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 08-24-2009, 06:45 PM
  3. Updating cpanel PHP changed main server php.ini
    By 4u123 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-06-2009, 03:46 PM
  4. Disabling local php.ini while php still runs in SUExec mode
    By gizmoh in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-10-2005, 12:34 PM
  5. PHP.INI Lost
    By psychodreams in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 01-24-2005, 01:43 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube