PHP Code Frequently Asked Questions

General Notes About Code

The code is designed for dynamic websites, i.e. websites that are able to use server-side code. This may include PHP, ASP, ASP.NET, PERL, Java Server Pages, Server Side Includes etc. Due to the functionality of our system, our code cannot work on static pages and we are unable to accept publishers who do not have dynamic pages.

The PHP Code is designed to work as is on any site and should not need to be modified. A publisher should be able to insert the code into the site, and it should work.
We have noticed a few PHP specific issues which we will address below in a Question and Answer format. If you have any problems getting the code to work on your site, please don't hesitate to ask us; we would like to make the code as robust as possible and to have this FAQ as complete as we can manage.

Sample File

You may download this sample file to your website to test the functionality and layout of the Ads. It will serve sample ads to confirm that your website can use our ad serving code.
Download the file here (Download the zipped file and unzip it to get the test files)  Download Sample Files

PHP Specific Questions


Q: How can I see if there is an Error with the code?

A: In order to prevent any disruptions for your site, our PHP code doesn't show any errors.
If you think there is a problem with your code and you would like to test it, just remove the @ signs from the functions and it will display the errors if there are any.


Q: I get an error that my hosting server can't open remote file. Might contain words like fopen() failed. What can I do?

A: Edit your php.ini file - Add or change the following line:
allow_url_fopen = on

If your host has disabled the fopen() function you may be able to use the curl() function. Try this code instead of the default code:


Q: I get the following error: This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. How can I fix this?

A: Edit your php.ini file - Add or change the following line:
cgi.force_redirect = 0


Q: Can I set the Timeout for the Connection to your server?

A: PHP has a default socket timeout of 60 seconds which means your site will wait for 60 seconds if there is a connection problem.
You can change the timeout by putting this in the php.ini file:
default_socket_timeout=3
That is a 3 second timeout which should be more than enough for most socket connections and definitely enough for our server connection.