Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Mar 2010
    Posts
    9

    Default editting php.ini breaks my server

    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. #2
    Member
    Join Date
    Jan 2011
    Posts
    505
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: editting php.ini breaks my server

    Hello Kenny,

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

    tail -f /usr/local/apache/logs/error_log

  3. #3
    Member
    Join Date
    Mar 2010
    Posts
    9

    Default Re: editting php.ini breaks my server

    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. #4
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: editting php.ini breaks my server

    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. #5
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: editting php.ini breaks my server

    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!
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  6. #6
    Member
    Join Date
    Mar 2010
    Posts
    9

    Default Re: editting php.ini breaks my server

    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. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: editting php.ini breaks my server

    What happens when you run /scripts/phpini command? Do you get any output at all? Please post the output.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  8. #8
    Member
    Join Date
    Mar 2010
    Posts
    9

    Default Re: editting php.ini breaks my server

    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.

Similar Threads & Tags
Similar threads

  1. php.ini and override default php.ini
    By areh in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 08-24-2009, 05:45 PM
  2. Updating cpanel PHP changed main server php.ini
    By 4u123 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-06-2009, 02:46 PM
  3. Server compromize by overiding php.ini
    By kiat in forum Security
    Replies: 15
    Last Post: 12-07-2008, 02:15 AM
  4. Server compromize by overiding php.ini
    By kiat in forum cPanel and WHM Discussions
    Replies: 15
    Last Post: 12-07-2008, 02:15 AM
  5. Replies: 1
    Last Post: 01-23-2005, 07:02 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube