Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

PHP Client Application

Last Updated: May 09, 2013
Text Size: A A A

Save to My Help

Save this article to My Help for easy reference. You can visit the article at any time from any computer.

Replace an article

You have reached the maximum number of saved articles. Your oldest saved article will be replaced with the new one.

To access Web Services using the sample PHP client application, follow these instructions.

Environment

To set up your PHP environment, install the following:

Note: Contact your system administrator if you need help setting up your PHP environment.

Source Code and Sample Data

For PHP, the source code zip file includes:

  • YahooAPTClient.php - PHP client application source code.
  • sample_data_US.properties - Sample data.
  • creative.zip - Zipped creatives.
  • video_creative.wmv - Video creative.
  • alternate_img.gif - Alternate image.

Build and Run

To build and run the PHP client application:

  1. Download YahooAPTClient-PHP.zip file, unzip the file, and copy them to your local directory.
    Ensure that creative.zip, alternate_img.gif, and video_creative.wmv files are in the same directory.
  2. Edit the YahooAPTClient.php file to insert your Web Services credentials:
    • EWS_USERNAME - Web Services user name.
    • EWS_PASSWORD - Web Services password.
    • EWS_ACCOUNT_ID - Web Services account ID.
    • EWS_LICENSE - Web Services license.
  3. Run the application using this command:
       prompt> php YahooAPTClient.php

Known Issues

If you encounter PHP Warning: file(): open_basedir restriction in effect. File(./sample_data_US.properties) is not within the allowed path(s): (/home/y/share/htdocs/:/home/y/share/pear/:/tmp/) in /home/ws/apt_sample_code/php/YahooAPTClient.php~ on line 608

For this error:

  1. Modify the php.ini file.
  2. Edit line open_basedir = ....
  3. Add :./ to the end of the line.

The PHP language does not support the 64 bit long data type. The maximum integer value in PHP is 2147483647. This limitation can cause PHP applications to generate bad requests if the 64 bit long data type is larger than 2147483647.

Please consider the following rules when writing PHP applications for Web Services.

  1. When an ID is represented as a string variable, cast it to float to ensure that values larger than 2147483647 are handled correctly.
  2. When an ID is represented as a numeric variable, the PHP runtime automatically casts large values to float.

 

Was this information helpful?      

My Help

Forgot your ID or password?

Sign In

Sign in to see your account information saved articles and more.
  1. Recent Searches (0)

  2. Saved Articles