logo
down
shadow

file_get_contents on other port


file_get_contents on other port

By : Caterina Buizza
Date : November 14 2020, 04:48 PM
Any of those help I must contact services rest on different ports by 80, but the function file_get_contents () returns an error: failed to open stream: Connection refused , Use CURL :
code :
<?php
$curl = curl_init('http://nexusdigital.agency/API/....'); 
curl_setopt($curl, CURLOPT_PORT, 81); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 81); 
$result = curl_exec($curl);
?>


Share : facebook icon twitter icon
Blank page when using file_get_contents() on a website with port 8080

Blank page when using file_get_contents() on a website with port 8080


By : James Ronaldo
Date : March 29 2020, 07:55 AM
should help you out file_get_contents fails because it cannot retrieve the content at hand. Most likely, a simplistic firewall is blocking all traffic to non-80 ports. You'll have to use port 80 to avoid these simplistic firewalls.
The failure to download the resource makes php emit a warning. Most likely, warnings are not displayed on the production server. Check the server's log and the display_errors and error_reporting configurations.
file_get_contents does not work on port 8282

file_get_contents does not work on port 8282


By : Steven Rasp
Date : March 29 2020, 07:55 AM
like below fixes the issue Ok, found the problem. Was sooo stupid. The problem is because the server that make the request (where the PHP file is), has a firewall enabled and the firewall allow only port 21, 22, 80, 3306 and 1433 for external request.
file_get_contents and port 8000

file_get_contents and port 8000


By : Rui Xu
Date : March 29 2020, 07:55 AM
wish helps you PHP has an option to block the file handling functions from working over a URL. This option is often switched on by hosting companies for security reasons.
Find out what the setting of this flag is -- use something like ini_get('allow_url_fopen') to find out whether it's allowed. My guess is that it'll be set not to allow it.
PHP file_get_contents from URL with PORT

PHP file_get_contents from URL with PORT


By : Jon Smith
Date : March 29 2020, 07:55 AM
Hope that helps Personally I'd use cURL and use CURLOPT_PORT to set the port you want to connect on.
code :
<?php
$cURL = curl_init('http://www.google.co.uk'); //Initialise cURL with the URL to connect to
curl_setopt($cURL, CURLOPT_PORT, 80); //Set the port to connect to
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true); //Get cURL to return the HTML from the curl_exec function

$HTML = curl_exec($cURL); //Execute the request and store the result in $HTML

echo $HTML; //Output the HTML
?>
file_get_contents and curl doesn't work, blocked tcp port problem

file_get_contents and curl doesn't work, blocked tcp port problem


By : Peter Jones
Date : March 29 2020, 07:55 AM
it should still fix some issue You're not stuck if you can convince the powers-that-be to allow you access through the firewall to the remote API to which you wish to connect. As long as you have a legitimate reason and the firewall access can be provisioned in a narrow scope (one specific IP and port), I don't see why you should have a problem getting this access.
Related Posts Related Posts :
  • how to run wordpress php snippet mysql update command from ssh and/ultimately cron
  • how to get xml tag by name
  • ModSecurity maximum post limits (PCRE limit errors)
  • Call controller/action in event listener
  • How to improve performance of contacting WebService?
  • PHP nest variable in echoed string that contains a HTML tag in the end
  • Multiple Ajax request for PHP framework
  • Debug Info from Moodle Plugin
  • passing variables through page
  • Passing PHP $result data to Javascript
  • cakePHP File Download was not found or not readable
  • batch waiting until script finishes
  • PHP variables and anchors in URL
  • php eTag generation using php
  • How to check whether the array is an Integer or Not?
  • Is it possible to install Doctrine without PEAR or Composer? If so, how?
  • Call view script of (parent) Abstract controller Zend
  • Curl PHP cannot display amazon
  • Symfony, getters and setters vs magic methods
  • Using 'continue' PHP instruction outside the loop
  • AJAX POST return data not appearing
  • Can I query relations using an INNER JOIN instead of two queries in Eloquent?
  • Looping through dynamic form fields and inserting into database
  • My php code can't select mysql auto_increment value
  • Store Angularjs form data in database using php
  • I want to run my sh file continuously even if I close my Putty connection
  • file_get_contents equivalent for gzipped files
  • Include PHP file with jQuery
  • php curl headers do not return from website?
  • How to find out, if facebook ID is a user, group or page
  • Connect webhost database to android database
  • preg_match get div content with class
  • Upload multiple files in Laravel 4
  • Count array numbers in multidimensional array
  • PHP Date diff with a difference
  • Search Customer by custom field in Netsuite
  • Is it possible to hide/encode/encrypt php source code and let others have the system?
  • list items to be displayed using php code and array
  • check if row exists mysqli
  • PHP errors loading MySQL
  • setup PostgreSQL with Laravel in MAMP
  • PHP - CodeIgniter Notifications
  • Encrypting a password column in a SQL database
  • New to PHP, trying to extract information from another website
  • JavaScript AmChart to Image for Email
  • Is javascript validation enough to keep my forms secure?
  • Regex extract variables from [shortcode]
  • Download a .mp3 link and save it to computer with PHP
  • Error with the ereg_replace
  • Getting the fields attached to a bundle of an entity in Drupal
  • Php how to check multiple times (within `foreach`) if values from array exists in mysql?
  • MySQL and PHP parsing strange string
  • Pull specific data from multidimensional associative array
  • How to get the original URI extension using PHP Tonic?
  • Upload videos and images from Android to PHP server?
  • Unset a multidimensional array with another multidimensional array with values than key
  • Calling a user e-mail to add to a mailto link PHP
  • Why is override_function coming back as an undefined function
  • PHP mySQLi_fetch_all: iterate through each row
  • Using pow in php
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org