guillermo, out of repose

Windows XP, Xampp, PHP, and Oracle 10g

I found this arti­cle while Googling around for a way to make Win­dows XP, Xampp, PHP and Ora­cle 10g work together. It cov­ers every­thing pretty well, but I just want to add a few notes to bring the arti­cle 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 writ­ing, Xampp is shipped with PHP 5.2.6, and comes with a few very use­ful exten­sions that are, by default, deac­ti­vated. To make 10g work with Xampp, all you need to do is uncom­ment the fol­low­ing line by remov­ing the “;” at the begin­ning of it
    ;extension=php_oci8.dll

    But to put your setup to bet­ter use, I rec­om­mend you also free up a few more extensions:

    • Read up on PDO. If you don’t think it’s use­ful, then, by all means, leave these lines com­mented out.
      extension=php_pdo_oci.dll
      extension=php_pdo_oci8.dll
      extension=php_pdo_odbc.dll
      extension=php_pdo_sqlite.dll
    • Check out Xde­bug if you haven’t already. See my note about PDO.
      extension=php_xdebug.dll
    • I per­son­ally find SplFile­Info to be a pretty use­ful class. You may disagree.
      extension=php_fileinfo.dll
  3. In case you couldn’t tell, the test code pro­vided in that arti­cle is spe­cific to that author’s local envi­ron­ment. To make sure the ora­cle exten­sion 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 what­ever you like) in your web doc­u­ment root, and open it up in a browser.

That’s all. Make sure this is only done in your local test­ing envi­ron­ment and not on any pro­duc­tion box. Now get codin’.