PHPackages                             loilo/native-open - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. loilo/native-open

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

loilo/native-open
=================

Open a file/URL/app from inside PHP, cross-platform

1.0.0(6y ago)2228MITPHPPHP &gt;= 7.1

Since Aug 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/loilo/native-open)[ Packagist](https://packagist.org/packages/loilo/native-open)[ RSS](/packages/loilo-native-open/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

 [![native-open logo: A mouse pointer, presented as a hand with extended index finger, floating above a colored circle representing an interactive area.](native-open.svg)](native-open.svg)

Native Open
===========

[](#native-open)

This package enables you to open a file/URL/app from inside PHP, cross-platform.

Note that it opens the app on *the machine running the PHP code*, so you can *not* use it to open apps on behalf of your website's users.

> Most of the credit for this package goes to [Sindre Sorhus](https://sindresorhus.com) as this is mostly a port of his [`open`](https://www.npmjs.com/package/open) package for Node.js.

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

[](#installation)

```
composer require loilo/native-open
```

Usage
-----

[](#usage)

```
use Loilo\NativeOpen\NativeOpen;

// Opens the image in the default image viewer
NativeOpen::open('picture.jpg');

// Opens the URL in the default browser
NativeOpen::open('https://github.com/loilo');

// Opens the URL in a specified browser
NativeOpen::open('https://github.com/loilo', 'firefox');

// Specify app arguments
NativeOpen::open('https://github.com/loilo', 'google chrome', ['--incognito']);
```

This package uses the `open` command on macOS, `start` on Windows and `xdg-open` on other platforms. Note that, if you define a specific app to open a target in, the app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1da49bad9203cc40a34d975dc00c80af09452bee1da6413e2f1b8214b539675?d=identicon)[loilo](/maintainers/loilo)

---

Top Contributors

[![loilo](https://avatars.githubusercontent.com/u/1922624?v=4)](https://github.com/loilo "loilo (4 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/loilo-native-open/health.svg)

```
[![Health](https://phpackages.com/badges/loilo-native-open/health.svg)](https://phpackages.com/packages/loilo-native-open)
```

###  Alternatives

[psr7-sessions/storageless

Storageless PSR-7 Session support

652373.0k8](/packages/psr7-sessions-storageless)[bryanjhv/slim-session

Session middleware and helper for Slim framework 4.

233961.5k16](/packages/bryanjhv-slim-session)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

36274.1k6](/packages/logiscape-mcp-sdk-php)[bepsvpt/blurhash

A PHP implementation of BlurHash with Laravel integration.

130259.9k5](/packages/bepsvpt-blurhash)[frosh/development-helper

Development Helper

90286.1k](/packages/frosh-development-helper)[worksome/coding-style

Worksomes coding style

49771.7k57](/packages/worksome-coding-style)

PHPackages © 2026

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