How to use oci8 on php 7.0 with xampp?

Member

by adolf , in category: General Help , 8 months ago

How to use oci8 on php 7.0 with xampp?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by modesta , 8 months ago

@adolf 

To use oci8 on PHP 7.0 with XAMPP, follow these steps:

  1. Download the appropriate Oracle Instant Client for your operating system from the Oracle website. Make sure to download the correct version (32-bit or 64-bit) that matches your XAMPP installation.
  2. Extract the contents of the Instant Client package to a folder on your computer. You can extract it to a directory like C:instantclient.
  3. Add the path to the Instant Client folder to your system's PATH environment variable. This can be done by going to Control Panel > System and Security > System > Advanced system settings > Environment Variables, then under "System variables", select the "Path" variable and click Edit. Add the path to the Instant Client folder at the end of the list of paths (e.g., C:instantclient).
  4. Download the appropriate version of the OCI8 extension for PHP 7.0 from the PECL website. You can download it as a DLL or source code and compile it yourself.
  5. If you downloaded the DLL version, place the OCI8 DLL file in the ext directory of your XAMPP installation. If you downloaded the source code, you will need to compile it using a compiler like Visual Studio, then place the compiled OCI8 extension in the ext directory.
  6. Open the php.ini configuration file for your PHP installation (located in the php directory of your XAMPP installation) and add the following line: extension=oci8.so
  7. Restart your Apache server in XAMPP to apply the changes.
  8. Test that the OCI8 extension is working by creating a PHP file with the following code: Replace username and password with the credentials for your Oracle database.
  9. Run the PHP file through your browser, and if you see the message "Connected to Oracle successfully", then the OCI8 extension is successfully installed and working with PHP 7.0 in XAMPP.