php-curl

Login to WS1 using curl

依然范特西╮ 提交于 2019-12-23 05:06:23
问题 I'm trying to login into ws1.com using curl, however whenever i put the POST to true I'm getting error: Bad Request, this is the code that i tried: <?php $LOGINURL = "https://secure2.ws1.com/login"; $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_multi_exec: some images downloaded are missing some data / stream incomplete

∥☆過路亽.° 提交于 2019-12-22 11:46:26
问题 I have implemented a PHP function which checks & downloads a lot of images (> 1'000) - as passed to it using an array - using the PHP curl_multi_init() method. After reworking this a few times already, because I was getting things like 0 bytes files, etc. I have a solution now which downloads all images - BUT every other image file downloaded is not complete. It looks to me as if I use file_put_contents() "too early", meaning, before some of the images' data has been received completely using

Apache cannot make outgoing HTTP Requests using curl

随声附和 提交于 2019-12-22 00:03:25
问题 Consider the following system configurations: Fedora 27 SELinux enabled Apache/2.4.33 PHP 7.1.17 And the below code snippet that is used to issue an http request to Sphere-Engine Compilers API: $ch = curl_init('http://xxxxxxxx.compilers.sphere-engine.com/api/v4/test?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 3.0); $x = curl_exec($ch); print_r($x); The above

GCM curl operation time out

痴心易碎 提交于 2019-12-21 17:28:26
问题 I have a couple of php files responsible for GCM operations stored on my server, they seem to work just fine when they want to but they often return an error that states: Curl error: Operation timed out after 0 milliseconds with 0 out of 0 bytes received Is this is a problem with the server or a problem with my GCM code? Below is my php file: <?php $message = urldecode($_POST['message']); $order = urldecode($_POST['order']); $registrationIDs = urldecode($_POST['registrationIDs']); $apiKey =

PHP 7.2 CURLFile Gives “Invalid Filename” Warning

大兔子大兔子 提交于 2019-12-20 06:29:28
问题 I am having an issue using the CURLFile object ( curl_file_create ). I have tried a number of approaches, but no matter what I try, I end up getting a PHP Warning in the log files and the file is omitted from my cURL call. First, some information: PHP 7.2 Files have been confirmed that they exist and are readable by PHP/Apache php-curl and related php libraries are up-to-date This is a snippet from within an object, thus the references to $this . All variables are loading correctly. This is a

Apache 2.4.23 PHP7.x Windows 10 x64 php_curl not working

我们两清 提交于 2019-12-19 04:17:06
问题 I was trying to upgrade my server to latest Apache 2.4.23 and PHP 7.1 but it fail to load php_curl library, don't know why. PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0 I have tried followings Change extension path to full path like d:\webserver\php\ext Copy php_curl.dll, libssh2.dll, libeay32.dll, ssleay32.dll to System32 , php/ext , apache/bin , php Added php path system variable Have

Scraping a dynamically loading website with php curl

我怕爱的太早我们不能终老 提交于 2019-12-17 17:23:04
问题 I am new to scraping and have scrapped two websites formally. But the problem appeared to me when I tried to scrape dynamic loading websites. When the website is rendered with JavaScript, I am unable to scrape the contents of the website then. Is there any way I can scrape the contents of that website using php curl or any other client related to PHP ? This is what I have done so far : $link = "https://www.glassdoor.com/Job/jobs.htm?suggestCount=0&suggestChosen=false&clickSource=searchBtn

Convert curl-command to php curl

与世无争的帅哥 提交于 2019-12-12 11:43:21
问题 Im trying to convert a curl-statement with an authentication header to a php curl request. But it doesn't seem to be working, because I receive the error below with echo 'error:' . curl_error($ch); : error:SSL certificate problem: unable to get local issuer certificate My curl-command looks like this: curl --user XXXX:YYYY "URL" My php-curl looks like this: $login = 'XXXX'; $password = 'YYYY'; $url = 'URL'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT

How to share on LinkedIn using REST-API v2?

荒凉一梦 提交于 2019-12-12 09:13:10
问题 I am having difficulty getting a share on linkedin. I am trying to post a LinkedIn share via linkedin api v2 and everytime I make the post request I get a request timed out (status 504) answer from the server. Here is my code : $url = https://api.linkedin.com/v2/ugcPosts?oauth2_access_token=".$row[0]['accesstoken']; $fields = '{ "author": "urn:li:person:XXX", "lifecycleState": "PUBLISHED", "specificContent": { "com.linkedin.ugc.ShareContent": { "shareCommentary": { "text": "Hello World! This

Streetview Publish API with PHP - The upload reference cannot be found

巧了我就是萌 提交于 2019-12-12 04:54:23
问题 I'm having some issues with the Streetview Publish API through PHP, attempting to replicate the procedure listed under "Uploading a photo" in the documentation https://developers.google.com/streetview/publish/first-app I've got the first part working and can retrieve the upload URL to a variable $upload_url. This is my code for step 2 $another = array( 'upload-file' => curl_file_create($imagepath) ); $header = array ( "Authorization: Bearer $accesstoken", "Content-Type: multipart/form-data" )