Random Splash

Windows XP, Xampp, PHP, and Oracle 10g / 2008-09-29

I found this article while Googling around for a way to make Windows XP, Xampp, PHP and Oracle 10g work together. It covers everything pretty well, but I just want to add a few notes to bring the article up to date.

  1. Your “php.ini” file will be found in your Xampp folder. If your setup is like mine, the path to the file is: C:\xampp\apache\bin\php.ini
  2. At the time of this writing, Xampp is shipped with PHP 5.2.6, and comes with a few very useful extensions that are, by default, deactivated. To make 10g work with Xampp, all you need to do is uncomment the following line by removing the “;” at the beginning of it;extension=php_oci8.dllBut to put your setup to better use, I recommend you also free up a few more extensions:
    • Read up on PDO. If you don’t think it’s useful, then, by all means, leave these lines commented out.extension=php_pdo_oci.dll
      extension=php_pdo_oci8.dll
      extension=php_pdo_odbc.dll
      extension=php_pdo_sqlite.dll
    • Check out Xdebug if you haven’t already. See my note about PDO.
      extension=php_xdebug.dll
    • I personally find SplFileInfo to be a pretty useful class. You may disagree.
      extension=php_fileinfo.dll
  3. In case you couldn’t tell, the test code provided in that article is specific to that author’s local environment. To make sure the oracle extension has been loaded, do the following:if (!function_exists('oci_connect')) {
    die('No dice, homes. You screwed something up.');
    }
    echo 'It works!!!';
    Throw in your php tags and save that to a file called “oracle.php” (or whatever you like) in your web document root, and open it up in a browser.

That’s all. Make sure this is only done in your local testing environment and not on any production box. Now get codin’.

Link / As usual, written by Guillermo A. Fisher.

One Response to “Windows XP, Xampp, PHP, and Oracle 10g”

  1. out of repose, in response / archives / CodeIgniter and Oracle Says:

    [...] database, I came across this great post which covers in part some of the items I mentioned in my previous Oracle-related post. So I got through it all, followed the instructions, but still couldn’t connect to the [...]

Leave a Reply