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.

editting php.ini breaks my server

Discussion in 'General Discussion' started by southcoastweb, Apr 28, 2011.

  1. southcoastweb

    southcoastweb Member

    Joined:
    Mar 30, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Morning all,

    I expect this is an easy fix but ive tried lots of things.

    I changed my php.ini file firstly through whm and as soon as i clicked save it stopped every php page working on my server.

    The only way i could get it restarted was to rebuild apache through easy apache.

    I then went into my sftp program and editted the php.ini and again it broke.
    Ive got full root axs onto my vps running WHM 11.28.87 / CENTOS 5.6 i686 xenpv .

    I cant figure out why it is breaking the php by changing the file even through WHM.

    Even if i do no changes and just save the php.ini as it is that breaks it.

    Anyone come across this before ?

    Kenny.
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello Kenny,

    It will be great if you post the result of error logs here.

    tail -f /usr/local/apache/logs/error_log
     
  3. southcoastweb

    southcoastweb Member

    Joined:
    Mar 30, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    This is the first error i get after saving the php.ini file.

    [11:05:34 2011] [error] [client 79.121.210.105] Premature end of script headers: pricelist.php

    Its the same error constantly on every php page that is viewed until the rebuild is complete.


    I have gone back through the error log for the whole week, although the problem has only been today.
    I can see another error that appears in lots of places. (Maybe that's why when i edit it breaks)

    [Mon Apr 18 11:08:35 2011] [error] [client 199.19.249.196] PHP: syntax error, unexpected '=' in /usr/local/lib/php.ini on line 777

    This is my php.ini file at line 777 >

    775 ; session.use_trans_sid: (ini file field description not available)
    776 session.use_trans_sid = 0
    777
    778 ; url_rewriter.tags: (ini file field description not available)
    779 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
    780
    781 ; sybase.allow_persistent: (ini file field description not available)
    782 sybase.allow_persistent = On

    but its only today where i have had the editing problem.

    Kenny
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,452
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    If simply saving the file after viewing is not working as expectd you might want to put in a ticket to cPanel Support.

    WHM > Support > Support Center > Contact cPanel
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    There are two cases opened about the WHM > PHP Configuration Editor causing duplicate entries to be added. Rather than editing or viewing the file in WHM using that editor, you'll need to edit it directly in root SSH for the time being.

    To rebuild the file when it corrupts after using the PHP Configuration Editor, you can do:

    Code:
    mv /usr/local/lib/php.ini /usr/local/lib/php.ini.bak110428
    /scripts/phpini
    At that point, then directly edit the /usr/local/lib/php.ini in shell directly. The PHP Configuration Editor cases are resolved in 11.30 with the cases being 46972 and 47683

    To see the changelog for 11.28 and 11.30 for cases, you can review Change Logs

    To see your cPanel version that is running on your machine, you can run this command:

    Code:
    cat /usr/local/cpanel/version
    To see the latest versions for each tier, you can go to this location:

    Downloads - cPanel Inc.

    Thanks!
     
  6. southcoastweb

    southcoastweb Member

    Joined:
    Mar 30, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the answer..

    i typed the following into shell as root :
    Code:
    mv /usr/local/lib/php.ini /usr/local/lib/php.ini.bak110428
    /scripts/phpini
    However it did not create a new php.ini file
    it renamed the old one php.ini.bak110428 but no new one anywhere..
    In WHM php configuration the advanced edit now shows as blank..

    But the sites still work... :):)

    I have since found in my folder an error_log which states :
    [27-Apr-2011 19:21:58] PHP Fatal error: [Zend Guard Loader] Extension "Zend Guard Loader" cannot be loaded twice in Unknown on line 0

    so that is probably the main cause, as you state..

    Any ideas how to get my php.ini back.

    Kenny
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What happens when you run /scripts/phpini command? Do you get any output at all? Please post the output.
     
  8. southcoastweb

    southcoastweb Member

    Joined:
    Mar 30, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    That worked,

    Strange it did nt work the first time probably me ..

    Its working fine now..

    I am going to try and get whm autopilot working now..

    Many Thanks,
    Kenny.
     
Loading...

Share This Page