Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX Call to PHP script gives me 500 Internal Server Error?
    text
    copied!<p>I make an AJAX request like so using JQuery:</p> <pre><code>$.ajax({ type: "GET", url: "getvideo.php", data: 'videoid=' + vid, </code></pre> <p>I use firebug to tell me what's going on and it tells me that a 500 internal server error has occurred? Here is part of the script concerned:</p> <pre><code>$videoid = $_GET['videoid']; $get = new youtubeAPI(); $get-&gt;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 </code></pre> <p>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 <strong>except</strong> on the other server the file is named "getvideo.php5" whereas here I named it "getvideo.php" since I have PHP 5.2.6 installed only. </p> <p>Please help</p> <h2>UPDATE</h2> <p>This is the error:</p> <blockquote> <p>[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: <a href="http://xx.xx.xx.xxx/" rel="nofollow noreferrer">http://xx.xx.xx.xxx/</a></p> </blockquote> <p>I hid my IP. At that line:</p> <pre><code>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-&gt;loadXML($string); @ini_restore('track_errors'); </code></pre> <p>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.</p> <h2>SOLVED</h2> <p>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. I should have tried that first.</p> <pre><code>yum install php-xml yum install php-xmlrpc </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload