Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 608687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:29:13+00:00 2026-05-13T17:29:13+00:00

i am using a youtube api php and have problem… OS: debian, php 5.2

  • 0

i am using a youtube api php and have problem…
OS: debian, php 5.2

<?php
    require_once 'Zend/Loader.php';
    Zend_Loader::loadClass('Zend_Gdata_YouTube');

    $yt = new Zend_Gdata_YouTube();
    $query = $yt->newVideoQuery();
    $query->setQuery($searchTerm);
    $query->setStartIndex($startIndex);
    $query->setMaxResults($maxResults);

    $feed = $yt->getVideoFeed($query);

    echo '<pre>';
    print_r($yt);

This code is empty return, but next code..

<?php
    require_once 'Zend/Loader.php';
    Zend_Loader::loadClass('Zend_Gdata_YouTube');

    $yt = new Zend_Gdata_YouTube();
    /*$query = $yt->newVideoQuery();
    $query->setQuery($searchTerm);
    $query->setStartIndex($startIndex);
    $query->setMaxResults($maxResults);

    $feed = $yt->getVideoFeed($query);*/

    echo '<pre>';
    print_r($yt);

has returned the object…

Zend_Gdata_YouTube Object
(
    [_defaultPostUri:protected] => 
    [_registeredPackages:protected] => Array
        (
            [0] => Zend_Gdata_Media_Extension
            [1] => Zend_Gdata_Media
            [2] => Zend_Gdata_YouTube_Extension
            [3] => Zend_Gdata_YouTube
            [4] => Zend_Gdata_Kind
            [5] => Zend_Gdata_Extension
            [6] => Zend_Gdata
            [7] => Zend_Gdata_App_Extension
            [8] => Zend_Gdata_App
        )

    [_httpClient:protected] => Zend_Http_Client Object
        (
            [config:protected] => Array
                (
                    [maxredirects] => 5
                    [strictredirects] => 1
                    [useragent] => Zend_Http_Client
                    [timeout] => 10
                    [adapter] => Zend_Http_Client_Adapter_Socket
                    [httpversion] => 1.1
                    [keepalive] => 
                    [storeresponse] => 1
                    [strict] => 1
                    [output_stream] => 
                )

            [adapter:protected] => 
            [uri:protected] => 
            [headers:protected] => Array
                (
                    [user-agent] => Array
                        (
                            [0] => User-Agent
                            [1] => MyCompany-MyApp-1.0 Zend_Framework_Gdata/1.10.0
                        )

                )

            [method:protected] => GET
            [paramsGet:protected] => Array
                (
                )

            [paramsPost:protected] => Array
                (
                )

            [enctype:protected] => 
            [raw_post_data:protected] => 
            [auth:protected] => 
            [files:protected] => Array
                (
                )

            [cookiejar:protected] => 
            [last_request:protected] => 
            [last_response:protected] => 
            [redirectCounter:protected] => 0
        )

    [_majorProtocolVersion:protected] => 
    [_minorProtocolVersion:protected] => 
    [_useObjectMapping:protected] => 1
)

Why? Where a problem?
Sorry for bah english

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:29:13+00:00Added an answer on May 13, 2026 at 5:29 pm

    ………

        require_once 'Zend/Loader.php';
        Zend_Loader::loadClass('Zend_Gdata_YouTube');
    
        $yt = new Zend_Gdata_YouTube();
        $query = $yt->newVideoQuery();
        $query->setQuery($searchTerm);
        $query->setStartIndex($startIndex);
        $query->setMaxResults($maxResults);
    
        $feed = $yt->getVideoFeed($query);
    
        echo '<pre>';
        print_r($yt);
    

    Instead of $yt, see what you have got in $feed eg:

        echo '<pre>';
        print_r($feed);
    

    has returned the object…

    This is because you are using print_r on object eg:

    $yt = new Zend_Gdata_YouTube();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Zend PHP Gdata API for Youtube to retrieve data and
I am using Zend Gdata to interface with the YouTube API from a PHP
I'm using Youtube API, I'd like to have a search auto-complete feature, just like
I'm trying to set up a quick PHP demo using the Youtube API that
I'm using PHP and the YouTube API to get videos from YouTube to feed
I have just started developing using Youtube API and stuck in very beginning. I
I'm using the Zend framework to access the YouTube Data API. The function below
re: http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Searching_for_Videos Im using the orderby or as the Zend gdata API calles it
I using Zend Gdata library for search video Youtube API. If I make a
Using Zend FW based Youtube api. Often getting errors on page load Fatal error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.