php function not work

Discussion in 'Site & Server Administration' started by A.G, May 23, 2009.

  1. #1
    Hi

    how can I enable this function " file_get_contents() " in php ?

    thanks
     
    A.G, May 23, 2009 IP
  2. SSANZ

    SSANZ Peon

    Messages:
    861
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In what environment are you using this?

    You can't enable it, as its not disabled by default afaik.
     
    SSANZ, May 23, 2009 IP
  3. A.G

    A.G Well-Known Member

    Messages:
    2,510
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    150
    #3
    I have unmanaged VPS CentOS and DirectAdmin installed
    when I installed a php script use that php function , it don't work and tell me that reason is file_get_contents() is disabled by your host
     
    A.G, May 23, 2009 IP
  4. Gr33n3gg

    Gr33n3gg Well-Known Member

    Messages:
    141
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    Edit your php.ini. For CentOS, your php.ini can be found in /usr/local/lib/php.ini or /etc/php.ini or phpinfo(); if all else fails.

    Use your favourite editor (mine is nano), edit your php.ini and uncomment the necessary line. Be careful though!
     
    Gr33n3gg, May 24, 2009 IP
    A.G likes this.
  5. A.G

    A.G Well-Known Member

    Messages:
    2,510
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    150
    #5
    thank you Gr33n3gg , I will try this
    Rep Up
     
    A.G, May 24, 2009 IP
  6. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #6
    Open up your php.ini and then do this

    Find allow_url_fopen and change this to On

    after this restart apache

    all done
     
    Bohra, May 24, 2009 IP
    A.G likes this.