1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Turn on php error logging with htaccess

Discussion in 'Site & Server Administration' started by bbrian017, Jan 26, 2010.

  1. #1
    Guys I don't know how to access my /etc/php.ini or how to edit it using SSH so I need help changing the site setting using a htaccess file.

    What is the code anyone know?
    SEMrush
    Thanks,

    Brian
     
    bbrian017, Jan 26, 2010 IP
    SEMrush
  2. sahabcse

    sahabcse Active Member

    Messages:
    272
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    90
    #2
    For access the /etc/ directory you need root privilege. Use some editor for edit the php.ini file. In command line use vi or vim editor, gedit etc.
     
    sahabcse, Jan 26, 2010 IP
  3. bbrian017

    bbrian017 Well-Known Member

    Messages:
    2,988
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    160
    #3
    I' really poor at SSH I used the htaccess way.

    # enable PHP error logging
    php_flag  log_errors on
    php_value error_log  /home/root/public_html/PHP_errors.log
    
    # prevent access to PHP error log
    <Files PHP_errors.log>
     Order allow,deny
     Deny from all
     Satisfy All
    </Files>
    Code (markup):
     
    bbrian017, Jan 26, 2010 IP
  4. hostechsupport

    hostechsupport Well-Known Member

    Messages:
    413
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    138
    #4
    Hello,

    First you should find the path of php.ini file in the server using following command
    php -i | grep php.ini
    Code (markup):
    Once you get a path, you can use either vi or nano editor. I would suggest nano as it is user friendly for newbies.
    like
    nano <file name>


    Thanks
     
    hostechsupport, Jan 26, 2010 IP
    bbrian017 likes this.
  5. bbrian017

    bbrian017 Well-Known Member

    Messages:
    2,988
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Thanks that's great information to know!
     
    bbrian017, Jan 26, 2010 IP
  6. maestria

    maestria Well-Known Member

    Messages:
    705
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #6
    "I need help changing the site setting using a htaccess file."

    By Editing the php.ini, you are modifying the global php setting and not for any individual site.
    What exactly are you trying to attain?
     
    maestria, Jan 28, 2010 IP
  7. bbrian017

    bbrian017 Well-Known Member

    Messages:
    2,988
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    160
    #7
    I need to be able to track my php errors on a new site I'm developing!
     
    bbrian017, Jan 29, 2010 IP