AJAX Call to PHP script gives me 500 internal server errors?

I am making an AJAX request, for example using jQuery:

$.ajax({ type: "GET", url: "getvideo.php", data: 'videoid=' + vid, 

Am I using firebug to tell me what is happening and it tells me that an internal 500 server error has occurred? Here is the script part:

 $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 for other scripts and they are fine. I used these scripts on another server, and on the other server it was fine except the file is called "getvideo.php5", whereas here I called it "getvideo.php", since I have PHP 5.2.6 installed only.

Please, help

UPDATE

This is mistake:

[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 in line 734, referent: http://xx.xx.xx.xxx/

I have hidden my IP. On this 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 should not play with this right? In any case, this class does not exist as a script and does not exist in this script as a class. I am using this same library in my other server. It is also missing that too ??? This is what I downloaded from the Zip Youtube API folder.

solvable

It was a completely new server and it installed minimal PHP. I lacked the functions of PHP dom. A quick installation fixed this problem. Thanks for reminding me to see the magazines. First I had to try.

 yum install php-xml yum install php-xmlrpc 
+7
ajax php apache
source share
7 answers

Try to manually make the call yourself in your browser (this is the same thing) and see what comes back. If nothing is returned and you get an internal 500 server error, you need to then look at your logs and see what causes this error.

Also make sure you make ajax call to the correct domain. If you try to call from your domain, the call will fail every time.

+9
source share

What? .php5 ? I don't know your apache configuration (given that you even use it), but .php will work for all versions of PHP.

In any case, try directly accessing this URL and see what happens, this should have nothing to do with Ajax. Also view your web server logs.

+2
source share

Make sure the permissions are set correctly. Just the same problem on justhost.com server. Set the permissions for my php script to 0644, and everything will be fine.

0
source share

I had a similar problem, but the solution was different. Check if you really downloaded all the files specified in the PHP code . I found out that the file that I called through ajax had references to classes whose definition files were missing, and the server returned 500 Internal server error for this.

0
source share

You probably just have a php copy and past (url) code error
And show you that the error will fix it, and everything should be in the order of luck

0
source share

Even I had a similar problem.

The error was caused by deleting the server from the code file.

access to the URL directly gave a blank page.

so they deleted one line of comments from the files and it worked.

-one
source share

I have the same error. Firebug will inform you of 500 internal server errors.

-5
source share

All Articles