Data feed file integration price comparison shopping script

Documentation Wiki - DataFeedFile.com - Online merchant datafeed integration for affiliates : EnablingPHPInclude

HomePage | Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Home Affiliate FAQ Merchant FAQ Examples Merchants Networks & Programs Forum Blog Wiki Knowledge Base Login

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.

Why some web hosting companies disable remote file inclusion?
Although DFF has been around for more than 3 years and content delivered by DFF is absolutely tested and safe, many shared hosting companies are just not taking any chances. Remote File Inclusion is a significant security hole.

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. Read more about using file_get_contents.

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.

How to Check if your allow_url_fopen and allow_url_include are on / off?
You can create a PHP file with the following content to test whether your PHP server setting is on/off for allow_url_fopen / allow_url_include:

<?php
echo 'allow_url_fopen = ' . ini_get('allow_url_fopen') . "<br>\n";
echo 'allow_url_include = ' . ini_get('allow_url_include') . "<br>\n";
?>


both allow_url_fopen and allow_url_include must be ON or "1" to use remote PHP include functionality.

Default PHP settings for allow_url_fopen and allow_url_include
allow_url_fopen "1" PHP_INI_ALL PHP_INI_ALL in PHP <= 4.3.4. PHP_INI_SYSTEM in PHP < 6. Available since PHP 4.0.4.
allow_url_include "0" PHP_INI_ALL PHP_INI_SYSTEM in PHP 5. Available since PHP 5.2.0.

See also Wikipedia's Remote File Inclusion page
http://en.wikipedia.org/wiki/RFI

There are no comments on this page. [Add comment]

Integrate price comparison shopping data feed file from thousands of online merchant product data feeds | Valid CSS

Page was generated in 0.0592 seconds