How do i create a php.ini file

Discussion in 'PHP' started by netpox, Aug 1, 2007.

  1. #1
    I need to turn off magic_quotes_gpc from my server. I am hosting with HostGator.com and i do not have my own dedicated server so i can't get into the root to change it. Their support told me to create my own php.ini file and just put it under the html_public folder in my directory.

    So how do i create a php.ini file that will turn off magic_quotes_gpc?
     
    netpox, Aug 1, 2007 IP
  2. pruad

    pruad Peon

    Messages:
    71
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you cann't access php.ini on shared hosting. But you can create .htaccess file in html_public folder and write into one:

    
    php_value magic_quotes_gpc 0
    
    Code (markup):
    This tuning will override PHP settings.

    Good luck ;)
     
    pruad, Aug 1, 2007 IP
  3. nomirock

    nomirock Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes its true that you cannot edit php.ini on dedicated servers but can still try the .htaccess method as pruad says
     
    nomirock, Aug 1, 2007 IP
  4. nagasharmi

    nagasharmi Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    beter you will htaccess file
     
    nagasharmi, Aug 1, 2007 IP
  5. netpox

    netpox Active Member

    Messages:
    1,625
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    90
    #5
    I tried doing this and got this error message when viewing my site:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
     
    netpox, Aug 2, 2007 IP