Weird Curl Problem - Works running off WAMP, but not on my hosted server

Discussion in 'PHP' started by jeeplaw, Nov 30, 2010.

  1. #1
    Anyone run into that issue before? I've got a script that will login into Adsense just fine if I run it off my thumbdrive's wamp install. But if I install it onto my host's webserver, it doesn't work. I know for sure that the host has the php and apache ini files edited to allow curl...what else should I be looking for?
     
    jeeplaw, Nov 30, 2010 IP
  2. peoplesmind

    peoplesmind Active Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Check curl settings, or try checking your server's error log and see what the error it spits out. If you don't have access to your error log, add this to the top of the php code, and run the script from a browser and see what error it gives you.

    ini_set('display_errors',1);
     
    peoplesmind, Nov 30, 2010 IP
  3. jeeplaw

    jeeplaw Well-Known Member

    Messages:
    827
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #3
    No errors are being reported
     
    jeeplaw, Nov 30, 2010 IP
  4. jeeplaw

    jeeplaw Well-Known Member

    Messages:
    827
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #4
    Here's the curl info from wampp

    curl

    cURL support enabled
    cURL Information 7.19.4
    Age 3
    Features
    AsynchDNS No
    Debug No
    GSS-Negotiate No
    IDN No
    IPv6 Yes
    Largefile Yes
    NTLM Yes
    SPNEGO No
    SSL Yes
    SSPI Yes
    krb4 No
    libz Yes
    CharConv No
    Protocols tftp, ftp, telnet, dict, ldap, http, file, https, ftps
    Host i386-pc-win32
    SSL Version OpenSSL/0.9.8k
    ZLib Version 1.2.3

    and all i know from my host is this:

    curl

    cURL support enabled
    cURL Information libcurl/7.21.1 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
     
    jeeplaw, Nov 30, 2010 IP
  5. jeeplaw

    jeeplaw Well-Known Member

    Messages:
    827
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #5
    Ok, i found this on another forum:

    Im opt to think that something may be wrong with the permissions for the apache/php user that calls curl.

    I say this because the script works fine on a test bed where PHP/Apache/ModSSL/Curl have been compiled from source - and not on this server, where they are using stock RPMS for Redhdat Fedora 1.

    Can someone suggest how I go about checking the user that PHP is running as? Or is it actually the user for Apache that is calling curl?

    ---
    I'm apt to think this may be the case..not sure though. How does one tell what user php/apache is calling curl?
     
    jeeplaw, Nov 30, 2010 IP
  6. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #6
    I posted already and deleted it, because you didn't post your code.... unless you do that, its just a guessing game. The problem can be anything, cookies if your using them, or some of the curl functions might be blocked, FOLLOWLOCATION is a common one some providers block, so that means you need to make 2 calls.
     
    MyVodaFone, Nov 30, 2010 IP
  7. socalcoder

    socalcoder Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    
    yum install php-curl
    yum install php-ssl
    service httpd restart
    
    PHP:
    If php works, the permission for php curl will work.
     
    socalcoder, Nov 30, 2010 IP
  8. jeeplaw

    jeeplaw Well-Known Member

    Messages:
    827
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #8
    Thanks guys, it's a host provider php permissions issue.
     
    jeeplaw, Dec 3, 2010 IP