URL FILE-ACCESS IS DISABLED AND NO SUITABLE WRAPPER FOR PHP REMOTE INCLUDE
If you are getting the following errors:
- URL file-access is disabled in the server configuration in ...
- include(): Failed opening 'http://www.datafeedfile.com/ ....
- ... failed to open stream: no suitable wrapper could be found in ...
Your PHP server probably does not allow remote PHP URL include or you need to enable the remote PHP include functionalities.
See notes below to enable URL file access / PHP remote include...
Required PHP server settings to use DFF remote PHP script includes
Eventhough by default PHP configuration (php.ini) enable the allow_url_fopen and allow-url-include by default, some PHP Hosting Companies actually have this option turned off by default for security reasons. Most of the time you can request for this option to be enabled or you can modify this PHP configuration value using
.htaccess (for Apache web server) file and inserting PHP value flags in the
.htaccess, or you can modify the
php.ini file itself.
Read this link to see how to modify the allow_url_fopen and allow-url-include option:
http://us3.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen
and
http://us3.php.net/manual/en/filesystem.configuration.php#ini.allow-url-include
Read this link to see how to modify .htaccess to insert option to allow_url_include:
http://us3.php.net/manual/en/configuration.changes.php
In-case you want to change other setting in the php.ini configuration file, here is the full list of directives:
http://us3.php.net/manual/en/ini.php
Using PHP's file_get_contents() Function
If your hosting company does not allow you to enable the allow_url_fopen and allow_url_include, you should try to use
file_get_contents() function next.
Using CURL
In case all of the above fails (or when your hosting company does not allow it) you can also use PHP's CURL. CURL is a well know libraries supported by many scripting languages to download / grab data from a particular HTTP/FTP URL.
Read about PHP CURL functionality.
Using fopen()
fopen can also be used to get content of any particular URL, even PHP script located remotely such as at DFF server.
To be able to use fopen function you must enable allow_url_include and allow_url_open settings in php.ini configuration file.
There are no comments on this page. [Add comment]