Community Support Team _ Alice Zhang If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. How to fix Apache 2 not executing PHP files - TechRepublic using fopen ()->fread ()->fclose () functions. It will use memory mapping techniques, if this is supported by the server, to enhance performance. php - file_get_contents( ) not working - Stack Overflow Now you can change the entry from allow_url_fopen=0 to allow_url_fopen=1 press "ctrl + x" and confirm the file save with "y". So I have used following code to get 2nd url contents. Create a new folder for this example project, and within it, create an index.html file with the following code: Steps to download the file: Initialize a file URL to the variable. First, we'll create an HTML form that the user will see when they want to upload the file. In the above example on parsing JSON file data via PHP, we have used file_get_contents() function. If they found request from script they simply disable page contents. Create cURL session. The methods are using file () fuction using file_get_contents () function using fopen ()->fread ()->fclose () functions using curl using fsockopen () socket mode using Third party library (Such as "snoopy") URL which is not retrieved by file_get_contents, because their server checks whether the request come from browser or any script. So I have used following code to get 2nd url contents. This function is the preferred way to read the contents of a file into a string. URL which is not retrieved by file_get_contents, because their server checks whether the request come from browser or any script. php - file_get_contents( ) not working - Stack Overflow php - file_get_contents is not working for some url - Stack Overflow The file_get_contents() will not work on the server because of the security directives enable with the PHP.ini configurations. Use the basename () function to return the file basename if the file path is provided as a parameter. PHP: file_get_contents - Manual Select the restore option to restore the DLL file. You can also use this function when creating a new file and you want to ensure that the file does not already exist on the server.