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.

Magic quotes = Off on php.ini but shows as On

Discussion in 'General Discussion' started by friedbrain, Feb 13, 2012.

  1. friedbrain

    friedbrain Member

    Joined:
    Feb 2, 2012
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    This is driving me nuts. Php.ini

    Code:
    ; Magic quotes
    ;
    
    ; Magic quotes for incoming GET/POST/Cookie data.
    ;magic_quotes_gpc = Off
    
    ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
    ;magic_quotes_runtime = Off
    
    ; Use Sybase-style magic quotes (escape ' with '' instead of \').
    ;magic_quotes_sybase = Off
    But it shows as on when installing a certain program and on phpinfo.php. I have tried the cpanel interface to redo the php /apache but no luck, they are still on but it shows as off (on cpanel too.)

    any suggestions?
     
    #1 friedbrain, Feb 13, 2012
    Last edited: Feb 13, 2012
  2. 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 friedbrain,

    In phpinfo page in that site's browser, what does it show for the following:

    Code:
    Loaded Configuration File 
    If it shows the user's web directory such as /home/username/public_html rather than /usr/local/lib/php.ini, then please check for a php.ini file in that user's directory.

    Otherwise, if that machine is using DSO, check the /home/username/public_html/.htaccess file for the directives, since they can be modified in .htaccess under DSO.

    To check the PHP handler itself to see if it is suPHP, DSO or what precisely, you can either check WHM > Apache Configuration > PHP and SuExec configuration area, or you can run the following command in root SSH:

    Code:
    /usr/local/cpanel/bin/rebuild_phpconf --current
    Thanks!
     
  3. friedbrain

    friedbrain Member

    Joined:
    Feb 2, 2012
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Tristan,

    # /usr/local/cpanel/bin/rebuild_phpconf --current
    Also
    I tried changing it with .htaccess but got 500 errors.

    Thanks
     
  4. 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 did you try changing with .htaccess specifically? If you want to have it off, try the following in .htaccess under DSO PHP handler:

    Code:
    php_value magic_quotes_gpc off
     
  5. luigidelgado

    luigidelgado Well-Known Member

    Joined:
    Nov 6, 2010
    Messages:
    109
    Likes Received:
    2
    Trophy Points:
    16
    Location:
    Mexico
    cPanel Access Level:
    Root Administrator
    Twitter:
    Im having this problem but with FCGI... php.ini from WHM editor has Magic Quotes turned off but still having a site with scape "/" been posted and making a mess... help.
     
  6. 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
    Please re-review the thread where I indicated checking this portion:

    Thanks.
     
  7. OcalaDesigns

    OcalaDesigns Member

    Joined:
    Jun 10, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I'm having the same problem. WHM on a Centos VPS, Magic quotes are turned off in php.ini in WHM. PHPInfo says it's on... the .htaccess has nothing in it that would turn it one. I don't know where else to check. Thoughts? I'm pretty sure I followed and checked everything above...

    Code:
    Loaded Configuration File = /usr/local/lib/php.ini
    
    Code:
    magic_quotes_gpc	On	On
    magic_quotes_runtime	Off	Off
    magic_quotes_sybase	Off	Off
    
    Default PHP Version (.php files) 5
    PHP 5 Handler suphp
    PHP 4 Handler none

    Apache suEXEC on
    Apache Ruid2 off
     
  8. OcalaDesigns

    OcalaDesigns Member

    Joined:
    Jun 10, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Nevermind, I found the issue, i think:

    If you leave magic quotes at the default setting in whm, which is off (**DEFAULT**, Click to Edit), the php.ini file leaves them commented out which leaves them 'on' by default I guess for some reason, or that is what it appears to be in phpinfo. When you turn magic quotes on and save, you will see that it is then uncommented, then when you turn it back off and save, it is uncommented in the off and phpinfo then will return that it is in fact off...

    Which I guess I would have to question what other items are being displayed as "off" that you want "off" but are actually still on if the (**DEFAULT**, Click to Edit) is visible in the WHM PHP editor...
     
    #8 OcalaDesigns, Aug 23, 2012
    Last edited: Aug 23, 2012
  9. 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 cPanel version are you running?

    Code:
    cat /usr/local/cpanel/version
    If WHM's PHP Editor shows them as off and has the field commented out, that might be considered a defect, since the assumption is they are off. We can test if this is happening and, if a case doesn't exist already, open an internal case about the issue.

    Thanks!
     
  10. NetShapersInc

    NetShapersInc Member

    Joined:
    Apr 13, 2012
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I can second this issue. Ours was set to **OFF** Default, but it was actually on. We were on WHM 11.32.4 (build 14) CENTOS 6.3 i686.

    I recycled the option on, then back off and it fixed the issue.
     
  11. 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
  12. grodde

    grodde Registered

    Joined:
    Nov 4, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Would have been nice if this was fixed soon, as it's causing a lot of trouble on servers trying to run with Joomla 3.0

    Cheers,
    Geir
     
  13. liam1412

    liam1412 Member

    Joined:
    Oct 5, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Is there still an active bug for this. It is still causing issues on a Laravel install for me on 11.34.0 Build 9. Seems it will not turn off regardless of what is ticked / unticked in easy apache!
     
  14. jakesully

    jakesully Well-Known Member

    Joined:
    Nov 9, 2011
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    you don't use easyapache to turn that line off you go to PHP editor in WHM and then set it to off manually then you save changes and if it still says it's on you would need to restart your apache server to make changes to take effect.
     
  15. effex100

    effex100 Registered

    Joined:
    Nov 30, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    This fixed the problem for me. Clicked edit button then set it to off. This issue seems to apply to other setting too. The installer I was running (Joomla 3.0) also flagged safe mode as On even though cPanel indicated it was set top off by default. Manually turning it off fixed this as well.
     
  16. tone

    tone Member

    Joined:
    Oct 20, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    This is still a fault in the most recent build: 11.38.0 (build 13). But the above does fix it.
     
  17. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you open a bug report for this issue and let us know the ticket number that you are assigned?

    Submit A Bug Report

    Thank you.
     
  18. jservices

    jservices Registered

    Joined:
    Oct 21, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I take it this is not yet resolved as I just performed a clean install of WHM v.11.38.2 and this issue is still present. This ticket was started over a year ago.
     
  19. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The "MAGIC QUOTES" feature has been DEPRECATED by PHP as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

    Thank you.
     
Loading...

Share This Page