php-curl

PHP cURL POST Jenkins job with parameters

蹲街弑〆低调 提交于 2019-12-12 03:37:17
问题 Triggering Jenkins job via following PHP script: <?php $testrun_id = "1744"; $cmd = "curl -X POST http://build:f9280f75396f83a0@mobile-jenkins.domain.com:8080/job/android-test/build --data-urlencode json='{\"parameter\": [{\"name\":\"POST_RESULTS\", \"value\":\"true\"}, {\"name\":\"RUN_ID\", \"value\":\"{$testrun_id}\"}, {\"name\":\"CHECK_NAME\", \"value\":\"SampleAutomatedPlan\"}]}'"; exec($cmd,$result); ?> This script runs successfully on Mac and the jenkins job does get triggered. How do I

unable to get user profile info from microsoft graph api

拜拜、爱过 提交于 2019-12-12 01:37:46
问题 I decided to create app from old azure portal and set the app to multi tenant. I have set the OAuth 2.0 token endpoint (https://login.microsoftonline.com/common/oauth2/token) for token and OAuth 2.0 authorization endpoint (https://login.microsoftonline.com/common/oauth2/authorize) for authorization. here is my code for authorization: header('location:https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&scope=openid%20profile&client_id=xxxxxxxxxxxxxxx&redirect_uri=http:

GA E-Commerce tracking in PHP

和自甴很熟 提交于 2019-12-11 19:08:28
问题 This is the code to send a purchase to Google Analytics E-Commerce tracking: it seems to be all right when executed on the debug URL https://www.google-analytics.com/debug/collect This is what the page returns: { "hitParsingResult":[ { "valid":true, "parserMessage":[ ], "hit":"/debug/collect?v=1\u0026tid=UA-XXXXXXXX-X\u0026cid=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\u0026t=event\u0026ti=UA-XXXXXXXX-X\u0026ta=test\u0026tr=1.00\u0026tt=0.22\u0026cu=EUR\u0026ts=0\u0026pa=purchase\u0026pr1id=ord690

Error on cURL request using php-cURL while sending SMS

别来无恙 提交于 2019-12-11 12:35:33
问题 The request entity's media type 'multipart/form-data' is not supported for this resource.\",\"ExceptionMessage\"unsure emoticon"No MediaTypeFormatter is available to read an object of type 'SmsQueue' from content with media type 'multipart/form-data'.\",\"ExceptionType\"unsure emoticon"System.Net.Http.UnsupportedMediaTypeException\",\"StackTrace\"unsure emoticon" at System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, Type type, IEnumerable 1 formatters, IFormatterLogger

“Could not resolve host” error with curl_multi on cURL version 7.64

时间秒杀一切 提交于 2019-12-11 03:31:02
问题 I'm getting "Could not resolve host" when I call curl_error($ch) in curl_multi context, the errno is 0 though, and the request is done successfully also(I'm getting the expected response from the remote server). I'm getting this error for all the requests in the curl_multi group, except for only the first request of them which is done without any error messages! (for example if the curl_multi has 10 sub requests attached to it, only the first request will not have the error and the other 9

File uploading through curl in php

☆樱花仙子☆ 提交于 2019-12-10 11:16:02
问题 I am trying to upload a file through curl on another server. I have created a script for this, but I am not able to get the $_FILES parameter. It's empty. $request = curl_init('http://localhost/pushUploadedFile.php'); $file_path = $path.$name; curl_setopt($request, CURLOPT_POST, true); curl_setopt( $request, CURLOPT_POSTFIELDS, array( 'file' => '@' . $file_path, 'test' => 'rahul' )); curl_setopt($request, CURLOPT_RETURNTRANSFER, true); echo curl_exec($request);exit(); pushUploadedFile.php:

Composer install missing curl-ext

旧城冷巷雨未停 提交于 2019-12-09 15:55:34
问题 I am developing some PHP on Ubuntu 14.04.4 LS. Running composer install is failing and I can't figure it out. This was working earlier when I was using PHP 5.5.9, but I had to update to at least 5.6 in order to install phpunit. Running php -v outputs: PHP 5.6.23-1+deb.sury.org~trusty+2 (cli) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies Running which php outputs:

After Ubuntu 18.04 upgrade php7.2-curl cannot be installed

心不动则不痛 提交于 2019-12-09 04:32:17
问题 Upgraded to 18.04 from 16.04 today using do-release-upgrade -d During the upgrade I was informed that some packages would be removed, these included: Remove: libperl5.22 lxc-common perl-modules-5.22 php-imagick php7.1-curl php7.2-curl python3-certbot-nginx I could re-install imagick and certbot without issue, but if I try to install php7.2-curl I get the message: # apt install php7.2-curl -y Reading package lists... Done Building dependency tree Reading state information... Done Some packages

curl php HTTP/2 stream 0 was not closed cleanly

喜欢而已 提交于 2019-12-07 20:16:35
问题 I am trying to send a request using cURL and PHP and it throws an error. HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) I am sending CURLOPT_HTTP_VERSION like this curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); cURL info printed with curel_version() is Array ( [version_number] => 475136 [age] => 4 [features] => 11518877 [ssl_version_number] => 0 [version] => 7.64.0 [host] => x86_64-apple-darwin18.2.0 [ssl_version] => OpenSSL/1.0.2q [libz_version] => 1.2.11

PHP Warning: PHP Startup: Unable to load dynamic library php_curl.dll impossibile find

一世执手 提交于 2019-12-07 10:00:56
问题 I have Windows 10 with WAMP server (Apache 2.4.9, PHP 5.5.29 VC11 x64, e MySQL). All works fine, but now I will use curl extension. I go into C:\wamp\bin\php\php5.5.29\phpForApache.ini (from webserver configuration) and remove the comment from extension=php_curl.dll reload apache server and in error_log I have [22-Sep-2015 13:13:30 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.29/ext/php_curl.dll' - Impossibile trovare il modulo specificato.in Unknown