+ Reply to Thread
Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By misson

Thread: curl_setopt() problem in 3rd party library

  1. #1
    shankhs84 is offline x10Hosting Member shankhs84 is an unknown quantity at this point
    Join Date
    May 2011
    Posts
    1

    curl_setopt() problem in 3rd party library

    Hi,
    I have recently started a new website project.
    To create a login page I am using 'Sign in with twitter' created using 3rd party library twitter-async which uses cURL a lot. Unfortunately I am getting the following error when running:

    Code:
    Warning:  curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/shankhs/public_html/twitter-async/EpiOAuth.php on line 148
    
    Warning:  curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/shankhs/public_html/twitter-async/EpiOAuth.php on line 148
    
    Warning:  curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/shankhs/public_html/twitter-async/EpiOAuth.php on line 148
    Can you please tell me a solution for this?

    Thank you
    shankhs

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: curl_setopt() problem in 3rd party library

    Try:
    cPanel -> File Manager to public_html/twitter-async
    Select the file EpiOAuth.php
    Open in Code Editor or regular editor
    Find line 148 (Code Editor has numbered lines, in the regular editor, search for 'CURLOPT_FOLLOWLOCATION'
    Comment the line out (put // in front of it)
    See if the script works.
    Nothing is always absolutely so.

  3. #3
    cybrax's Avatar
    cybrax is offline x10 Elder cybrax is on a distinguished road
    Join Date
    Aug 2009
    Location
    UK
    Posts
    699

    Re: curl_setopt() problem in 3rd party library

    Think you're going to be out of luck, if I recall correctly getting the cURL option FOLLOWLOCATION to work requires altering the shared server's php.ini file.
    The code must flow.
    Project 157: Latest UK Jobs direct to your mobile phone
    New Domain under construction: Lovelogic.net
    home for some new projects that we can't keep here ;)


  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: curl_setopt() problem in 3rd party library

    Quote Originally Posted by cybrax View Post
    Think you're going to be out of luck, if I recall correctly getting the cURL option FOLLOWLOCATION to work requires altering the shared server's php.ini file.
    That's why I told him to comment out the line.

    That option is just telling cURL to follow redirects. If the service doesn't use redirects, removing the option should not break the script. If it does use redirects, one would have to add code to detect and follow any redirects
    Nothing is always absolutely so.

  5. #5
    cybrax's Avatar
    cybrax is offline x10 Elder cybrax is on a distinguished road
    Join Date
    Aug 2009
    Location
    UK
    Posts
    699

    Re: curl_setopt() problem in 3rd party library

    True, but would not adding code to detect where the redirect went be circumventing the security restriction that the followlocation option was initially disabled for? Anyhow its been a while since I did any messing about with Oauth so will be interesting to see learn how shankhs gets on.
    The code must flow.
    Project 157: Latest UK Jobs direct to your mobile phone
    New Domain under construction: Lovelogic.net
    home for some new projects that we can't keep here ;)


  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: curl_setopt() problem in 3rd party library

    @cybrax: The security restriction was implemented due to a security whole opened by "file:" URLs, which are a problem because the cURL library is unaware of PHP's safe_mode and open_basedir features. A PHP implementation of redirect following won't introduce a vulnerability because it is subject to these features.
    Last edited by misson; 05-18-2011 at 12:13 AM.
    cybrax likes this.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers