In this tutorial, we’ll walk through the steps to install and configure the OCI8 extension on Laragon with PHP 8.3. The OCI8 extension allows PHP to connect to Oracle databases, and setting it up can be a bit tricky.
1. Download Oracle Instant Client
To use the OCI8 extension, you need to download the Oracle Instant Client. Go to the Oracle Instant Client for Windows x64 downloads page and get the following:
- instantclient-basic-windows.x64-23.6.0.24.10.zip
- instantclient-sdk-windows.x64-23.6.0.24.10.zip
Once the downloads are completed, extract both files and move the contents to C:oracleinstantclient_23_6.
2. Add Environment Variable
To make the Oracle Instant Client accessible system-wide, we need to register the Instant Client path to our system.
- Search for Edit the system environment variables and then click on the Environment Variables button.
- In the System variables section, click on Path and edit.
- Add a new value, C:oracleinstantclient_23_6, and click OK.
You can close all the windows now.
For the changes to take effect, restart your computer.
3. Download PHP 8.3
By default, Laragon shipped with PHP 8.1 only, but we can add other PHP versions easily.
Head to PHP for Windows and get your preferred version. In this tutorial, we will download the following:
- PHP 8.3 VS16 x64 Thread Safe.
Once the download is complete, extract the file on your computer. Then, move the folder php-8.3.14-Win32-vs16-x64 to C:laragonbinphpphp-8.3.14-Win32-vs16-x64.
4. Upgrade Apache for PHP 8.3 Compatibility
Now we need to upgrade Apache bundled with Laragon to the latest version to prevent the httpd.exe - Entry Point Not Found error.
Visit Apache Lounge and download the latest version of Apache, at the time of writing, the latest version is httpd-2.4.62-240904-win64-VS17.
Once downloaded, extract the file and move all files and folders inside this httpd-2.4.62-240904-win64-VS17Apache24 folder to the parent folder httpd-2.4.62-240904-win64-VS17.
We can safely delete the Apache24 folder.
5. Configure Laragon
Open the Laragon application to change the Apache and enable OCI8 extension. Stop all services first, just to be safe.
Apache
Select the new Apache version using the menu Apache > Version > httpd-2.4.62-240904-win64-VS17.
OCI8 extension
Enable OCI8 extension by using the menu PHP > Extensions > oci8_19.
Now we can start all services and test.
6. Test
To verify that OCI8 is installed and working, create a new blank project in Laragon by using Quickapp > Blank.
Create a new file inside this project and add the following codes:
<?php if (function_exists('oci_connect')) { echo "OCI is installed"; } else { echo "OCI is not installed"; }
Run the project in your web browser and you should see OCI is installed.
Congratulations! You’ve successfully installed and configured the OCI8 extension on Laragon with PHP 8.3. You can now connect your PHP applications to Oracle databases.
If you encounter any issues, double-check the steps above or consult the official documentation for further assistance.
Happy coding! ?
The above is the detailed content of How to install PHP with OCIn Laragon. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

ToversionaPHP-basedAPIeffectively,useURL-basedversioningforclarityandeaseofrouting,separateversionedcodetoavoidconflicts,deprecateoldversionswithclearcommunication,andconsidercustomheadersonlywhennecessary.StartbyplacingtheversionintheURL(e.g.,/api/v

TosecurelyhandleauthenticationandauthorizationinPHP,followthesesteps:1.Alwayshashpasswordswithpassword_hash()andverifyusingpassword_verify(),usepreparedstatementstopreventSQLinjection,andstoreuserdatain$_SESSIONafterlogin.2.Implementrole-basedaccessc

Proceduralandobject-orientedprogramming(OOP)inPHPdiffersignificantlyinstructure,reusability,anddatahandling.1.Proceduralprogrammingusesfunctionsorganizedsequentially,suitableforsmallscripts.2.OOPorganizescodeintoclassesandobjects,modelingreal-worlden

PHPdoesnothaveabuilt-inWeakMapbutoffersWeakReferenceforsimilarfunctionality.1.WeakReferenceallowsholdingreferenceswithoutpreventinggarbagecollection.2.Itisusefulforcaching,eventlisteners,andmetadatawithoutaffectingobjectlifecycles.3.YoucansimulateaWe

To safely handle file uploads in PHP, the core is to verify file types, rename files, and restrict permissions. 1. Use finfo_file() to check the real MIME type, and only specific types such as image/jpeg are allowed; 2. Use uniqid() to generate random file names and store them in non-Web root directory; 3. Limit file size through php.ini and HTML forms, and set directory permissions to 0755; 4. Use ClamAV to scan malware to enhance security. These steps effectively prevent security vulnerabilities and ensure that the file upload process is safe and reliable.

Yes, PHP can interact with NoSQL databases like MongoDB and Redis through specific extensions or libraries. First, use the MongoDBPHP driver (installed through PECL or Composer) to create client instances and operate databases and collections, supporting insertion, query, aggregation and other operations; second, use the Predis library or phpredis extension to connect to Redis, perform key-value settings and acquisitions, and recommend phpredis for high-performance scenarios, while Predis is convenient for rapid deployment; both are suitable for production environments and are well-documented.

In PHP, the main difference between == and == is the strictness of type checking. ==Type conversion will be performed before comparison, for example, 5=="5" returns true, and ===Request that the value and type are the same before true will be returned, for example, 5==="5" returns false. In usage scenarios, === is more secure and should be used first, and == is only used when type conversion is required.

The methods of using basic mathematical operations in PHP are as follows: 1. Addition signs support integers and floating-point numbers, and can also be used for variables. String numbers will be automatically converted but not recommended to dependencies; 2. Subtraction signs use - signs, variables are the same, and type conversion is also applicable; 3. Multiplication signs use * signs, which are suitable for numbers and similar strings; 4. Division uses / signs, which need to avoid dividing by zero, and note that the result may be floating-point numbers; 5. Taking the modulus signs can be used to judge odd and even numbers, and when processing negative numbers, the remainder signs are consistent with the dividend. The key to using these operators correctly is to ensure that the data types are clear and the boundary situation is handled well.
