• 05-12-2013, 18:19:10
    #1
    Merhaba Arkadaşlar.
    Çok ilginç bir sorunum var. Bir veriyi post etmek istiyorum curl ile lakin ilk başlarda proxy kullanmadan da fazla içerik yazınca göndermiyordu sonra serverımın memory_limitini ve post_max_size limitini yükselterek bu sorunu aştım. Daha sonra proxy kullandım yine aynı sorunu verdi. Proxy hizmetini aldığım yerede bildirdim ve onlarda saolsunlar limiti yükseltti. Lakin sorunum devam etmektedir.
    1000 karakterin altında veri yolladığım zaman sorunsuz bir şekilde gönderim yapabiliyorum. Fakat 1000 karakteri geçince sistemin eli ayağına dolaşıyor.

    Curl sonucunu yazdırıyorum verdiği cevap şu
    ERROR
    
    The requested URL could not be retrieved
    
    Invalid Request error was encountered while trying to process the request:
    
    POST /gonderim/******************/posts/default HTTP/1.1
    Proxy-Authorization: Basic c29zeWFsOnV6ZWw3NGV2
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
    Host: www.*******.com
    Accept: */*
    Proxy-Connection: Keep-Alive
    Content-Type: application/atom+xml
    Content-Length: 1028
    Authorization: ****** auth=**********************************
    Expect: 100-continue
    Some possible problems are:
    
    Missing or unknown request method.
    
    Missing URL.
    
    Missing HTTP Identifier (HTTP/1.0).
    
    Request is too large.
    CURL burada

    		$ch = curl_init();
    		curl_setopt($ch, CURLOPT_URL, 'http://www.*****.com/gonderim/'.$this->id.'/posts/default');
    		curl_setopt($ch, CURLOPT_POST, 1);
    		curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    	    curl_setopt($ch, CURLOPT_TIMEOUT, 60);  
    		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
    	    curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); 
    		curl_setopt($ch, CURLOPT_PROXY, $proxy_ip_adres); // Don't forget the port of the proxy... they're not all 80
    		curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_ip_port );
    		curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'kullanici_adi:sifre');
    
    		curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    
    
    		curl_setopt($ch, CURLOPT_HEADER, 0);
    		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
    		curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
    		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  • 05-12-2013, 18:23:28
    #2
    Üyeliği durduruldu
    Ne alakası var bilmiyorum ama $xml değişkenini urlencode fonksiyonundan geçirip post etmeyi denediniz mi ?
  • 05-12-2013, 18:27:02
    #3
    siz söyleyince denedim hocam yok işe yaramadı.
    992 karakter yolluyor 1031 karakteri yollamıyor.
    bu arada upload_max_filesize limiti de yüksek arkadaşlar
  • 07-12-2013, 01:15:43
    #4
    hocam sorununuzu merak edip araştırdığımda stackoverflow.com'da çözüm olarak dizi olarak göndermekten bahsetmişler aşağıdaki mesaj belki yol gösterebilir,

    Alıntı
    The problem is the proxy out institute using is "SQUID". And Squid doesn't support Expect: 100-continue.

    So finally added this to my options

    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
    and its all working fine.
  • 07-12-2013, 08:36:32
    #5
    post_max_size
    LimitRequestBody

    Bu ayarları arttırmayı deneyin.