PHPackages                             shopsze/oci-php-sdk-shopsze - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. shopsze/oci-php-sdk-shopsze

ActiveLibrary[API Development](/categories/api)

shopsze/oci-php-sdk-shopsze
===========================

OCI SDK for PHP - Oracle Cloud Infrastructure services in your PHP project

0124PHP

Since Feb 16Pushed 3mo agoCompare

[ Source](https://github.com/logan0470/oci-php-sdk-shopsze)[ Packagist](https://packagist.org/packages/shopsze/oci-php-sdk-shopsze)[ RSS](/packages/shopsze-oci-php-sdk-shopsze/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Oracle Cloud Infrastructure SDK for PHP
=======================================

[](#oracle-cloud-infrastructure-sdk-for-php)

About
-----

[](#about)

oci-php-sdk provides an SDK for PHP that you can use to manage your Oracle Cloud Infrastructure resources.

The project is open source and maintained by Oracle Corp. The home page for the project is [here](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdks.htm).

Requirements
------------

[](#requirements)

- PHP 8.0

Installation
------------

[](#installation)

### Consuming the oci-php-sdk from a zip file

[](#consuming-the-oci-php-sdk-from-a-zip-file)

1. Create a directory, e.g. `/path/to/artifacts`
2. Place the internal OCI PHP SDK zip file, e.g. `oci-php-sdk-0.0.1-2021-11-02T13-44-29.zip`, in that directory.
    - If you have multiple versions of the zip file, make sure the directory only contains the version you want to use.
3. Add a dependency on `oracle/oci-php-sdk` version `0.0.1` to your `composer.json` file
4. Add a repository of type `artifact` to your `composer.json` file, where `url` is set to the directory with the zip file, e.g. `/path/to/artifacts`

Here is a complete example of such a `composer.json` file:

```
{
    "name": "oracle/oci-php-sdk-consumer",
    "type": "project",
    "require": {
        "oracle/oci-php-sdk": "0.0.1"
    },
    "repositories": [
        {
            "type": "artifact",
            "url": "/path/to/artifacts"
        }
    ]
}

```

5. Clear your Composer cache, `vendor` directory, and `composer.lock` file:

```
composer clear-cache && rm -rf vendor; rm composer.lock

```

- This helps make sure that `vendor` contains the latest contents from the zip file.

6. Run `composer install`
7. In your source file, e.g. `src/test.php`, require the `vendor/autoload.php` file, and then use the OCI PHP SDK classes you need. For example:

```

```

8. Run the test: `php src/test.php`

### Consuming the oci-php-sdk from a Git repository

[](#consuming-the-oci-php-sdk-from-a-git-repository)

1. Add a dependency on `oracle/oci-php-sdk` version `dev-master` to your `composer.json` file
2. Add a repository of type `git` to your `composer.json` file, where `url` is set to the same URL you use to `git clone`, e.g. `https://github.com/organization/my-repo.git`
    - **Note**: `https://github.com/organization/my-repo.git` is not an actual Git repository with the OCI PHP SDK.

Here is a complete example of such a `composer.json` file:

```
{
    "name": "oracle/oci-php-sdk-consumer",
    "type": "project",
    "require": {
        "oracle/oci-php-sdk": "dev-master"
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/organization/my-repo.git"
        }
    ]
}

```

3. Clear your Composer cache, `vendor` directory, and `composer.lock` file:

```
composer clear-cache && rm -rf vendor; rm composer.lock

```

- This helps make sure that `vendor` contains the latest contents from the Git `master` branch

4. Run `composer install`
5. In your source file, e.g. `src/test.php`, require the `vendor/autoload.php` file, and then use the OCI PHP SDK classes you need. For example:

```

```

8. Run the test: `php src/test.php`

Examples
--------

[](#examples)

Examples can be found [here](/tests/Oracle/Oci/Examples/).

You may run any example by invoking the `php` command with the example you want to run, for example: `php tests/Oracle/Oci/Examples/ObjectStorageExample.php`

Documentation
-------------

[](#documentation)

### Installing PHP 8.0 on Oracle Linux 8

[](#installing-php-80-on-oracle-linux-8)

The following has worked for installing PHP 8.0 on Oracle Linux 8:

```
sudo dnf module list php
sudo dnf install @php:8.0 -y

```

### Installing Composer

[](#installing-composer)

Install Composer as package manager for PHP:

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer

```

### Running the Instance Principals Example

[](#running-the-instance-principals-example)

The [`tests/Oracle/Oci/Examples/InstancePrincipalsExample.php`](/tests/Oracle/Oci/Examples/InstancePrincipalsExample.php) and [`tests/Oracle/Oci/Examples/CachingInstancePrincipalsExample.php`](/tests/Oracle/Oci/Examples/CachingInstancePrincipalsExample.php) examples must be run on an OCI instance. To set it up, you can follow these steps:

1. Create a dynamic group. You can use a matching rule like this to get all instances in a certain compartment:

    ```
    Any {instance.compartment.id = ''}

    ```
2. Start an OCI instance. Make sure that it is matched by the dynamic group, e.g. by creating it in the correct compartment.
3. Create a policy for the dynamic group that grants the desired permissions. For example:

    ```
    Allow dynamic-group  to manage buckets in compartment
    Allow dynamic-group  to manage objects in compartment
    Allow dynamic-group  to manage objectstorage-namespaces in compartment

    ```
4. Install PHP 8.0 on Oracle Linux. See above.
5. Copy the OCI PHP SDK and this example to the OCI instance (using `scp` or `rsync`).
6. Run Composer to download the required packages:

    ```
    composer update
    composer install

    ```
7. SSH into the OCI instance.
8. Run the example:

    ```
    php tests/Oracle/Oci/Examples/InstancePrincipalsExample.php

    ```
9. Run the Instance Principal-specific unit tests:

    ```
    php vendor/bin/phpunit --group InstancePrincipalsRequired

    ```

Changes
-------

[](#changes)

See [CHANGELOG](/CHANGELOG.md).

Contributing
------------

[](#contributing)

This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)

Security
--------

[](#security)

Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process

Known Issues
------------

[](#known-issues)

You can find information on any known issues with the SDK [here](https://docs.cloud.oracle.com/iaas/Content/knownissues.htm).

### Thread Safety

[](#thread-safety)

The OCI PHP SDK is based on the `GuzzleHttp\Client`; therefore, it has the same threading behavior as `GuzzleHttp\Client`.

There does not appear to be good documentation on the thread safety of `GuzzleHttp\Client`, but there are hints that it is *NOT* thread-safe:

1. "Are you using threads (like with pthreads)? Guzzle is not thread safe and will not work in a multithreaded application" [1](https://github.com/guzzle/guzzle/issues/1504)
2. "I would guess that the underlying cURL handles, and PHP's integration with cURL, have an issue being shared across multiple threads. You may have to create unique clients for each thread." [2](https://github.com/guzzle/guzzle/issues/1398)

These issues are not unique to the OCI PHP SDK, and the solution seems to simply be to create a separate client per thread.

License
-------

[](#license)

Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at or Apache License 2.0 as shown at . You may choose either license.

See [LICENSE](/LICENSE.txt) for more details.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance55

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/91370579?v=4)[logan0470](/maintainers/logan0470)[@logan0470](https://github.com/logan0470)

---

Top Contributors

[![ZiyaoQiao](https://avatars.githubusercontent.com/u/13175637?v=4)](https://github.com/ZiyaoQiao "ZiyaoQiao (8 commits)")[![logan0470](https://avatars.githubusercontent.com/u/91370579?v=4)](https://github.com/logan0470 "logan0470 (6 commits)")[![spavlusieva](https://avatars.githubusercontent.com/u/99655698?v=4)](https://github.com/spavlusieva "spavlusieva (5 commits)")[![mricken](https://avatars.githubusercontent.com/u/771548?v=4)](https://github.com/mricken "mricken (2 commits)")

### Embed Badge

![Health badge](/badges/shopsze-oci-php-sdk-shopsze/health.svg)

```
[![Health](https://phpackages.com/badges/shopsze-oci-php-sdk-shopsze/health.svg)](https://phpackages.com/packages/shopsze-oci-php-sdk-shopsze)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
