Programmer’s Journal
Getting XML objects while using Mediawiki API + AJAX
Problem/Error: Trying to obtain a responseXML object from a Mediawiki API query results in a null pointer. A responseText object, however, returns the HTML text just fine.
Solution: What’s happening here is that Mediawiki API is responding to the AJAX request (GET or POST, it doesn’t matter) using the default format, namely, a plain text, HTML formatted version of the original XML. To obtain an XML object (or any other kind of object that Mediawiki knows, for that matter e.g. JSON), you have to explicitely tell the API in which format you require the answer. For example:
Programmer’s Journal
XAMPP for Linux setup
Today I got XAMPP for Linux (formerly known as LAMPP) finally up and running. Here are some caveats that I encountered while completing the installation:
- Though the “installation” of XAMPP is supposed to be as simple as “uncompress and run” it actually needs you to take care of the right permissions for some of the folders in the installation directory. Unless you are a security freak, the best thing you can do is the following:
- chmod -R 644 /opt/lampp (assumming that your installation directory is actually “/opt”)
- chmod -R 755 /opt/lamp/htdocs (to avoid some problems with the stuff you will install inside later on)
- If after doing the pervious step you ever encounter the error “ERROR 2002: Can’t connect to local MySQL server through socket” when you try to start phpMyAdmin, you need to go to the folder phpMyAdmin in the XAMPP installation (/opt/lamp/phpmyadmin) and change the permissions of the file config.inc.php to “644″ (chmod 644 /opt/lampp/phpmyadmin/config.inc.php). I admit that this is a weird fix, but for some reason phpMyAdmin doesn’t like other permissions than this when telling XAMPP to connect to the database and produces an even weirder error which is totally unrelated to the actual permission problem…
Anyway, i’ll keep posting some other tips I find…



