Hi
I make an AJAX request like so using JQuery:
$.ajax({
type: "GET",
url: "getvideo.php",
data: 'videoid=' + vid,
I use firebug to tell me whats going on and it tells me a 500 internal server error has occurred? wtf Here is part of the script concerned:
$videoid = $_GET['videoid'];
$get = new youtubeAPI();
$get->getVideoAPI($videoid);
class youtubeAPI extends Exception {
function getVideoAPI($videoid){
if(isset($videoid)){
$clientLibraryPath = 'library';
$oldPath = set_include_path(get_include_path().PATH_SEPARATOR.$clientLibraryPath);
require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path
I use the same AJAX call to other scripts and they are fine. I have used these scripts on another server and it was fine except on the other server the file is named "getvideo.php5" whereas here I name it "getvideo.php" since I have PHP 5.2.6 installed only.
Please help
UPDATE
This is the error:
[Wed Feb 11 20:48:17 2009] [error] [client xx.xx.xxx.xxx] PHP Fatal error: Class 'DOMDocument' not found in /var/www/html/library/Zend/Gdata/App.php on line 734, referer: http://xx.xx.xx.xxx/
I hid my IP. At that line:
public static function importString($string, $className='Zend_Gdata_App_Feed')
{
// Load the feed as an XML DOMDocument object
@ini_set('track_errors', 1);
$doc = new DOMDocument(); //LINE 734
$success = @$doc->loadXML($string);
@ini_restore('track_errors');
But I shouldn't be playing around with that right? In any case, that class doesn't exist as a script and doesn't exist in that script as a class. I AM MAKING USE OF THIS SAME LIBRARY IN MY OTHER SERVER. It is also missing that too??? This is what I downloaded from the Youtube API zip folder.
SOLVED
This was a brand new server and it had minimal PHP installed. I was missing PHP dom functions. A quick install fixed this problem. Thanks for reminding me to look at the logs. Should of been my first try.
yum install php-xml
yum install php-xmlrpc