PHPackages                             orange35/phpv - 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. orange35/phpv

ActiveLibrary

orange35/phpv
=============

PHP Wrapper to run a correct PHP CLI version specified in the .htaccess\_dev, .htaccess or .phpv file

1.0.1(6y ago)191MITShell

Since Sep 24Pushed 6y ago2 watchersCompare

[ Source](https://github.com/orange35/phpv)[ Packagist](https://packagist.org/packages/orange35/phpv)[ RSS](/packages/orange35-phpv/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Automatic PHP CLI Version
=========================

[](#automatic-php-cli-version)

[![](orange35-phpv-usage.gif)](orange35-phpv-usage.gif)

**orange35/phpv** is a php wrapper which replaces the **php** command and executes a PHP CLI version specified in the one of the following files:

- .htaccess\_dev \***1**
- .htaccess
- .phpv

**For example:**

When you run the following command

```
php -v

```

PHP Wrapper searches for first of following files:

- ./.phpv
- ./.htaccess\_dev
- ./.htaccess
- ./public/.htaccess\_dev
- ./public/.htaccess
- ./www/.htaccess\_dev
- ./www/.htaccess
- ./public\_html/.htaccess\_dev
- ./public\_html/.htaccess

If it is either a .htaccess\_dev or .htaccess file it is looks for a string like:

```
SetHandler proxy:fcgi://php71

```

or

```
AddHandler application/x-httpd-php71 .php

```

if it is a .phpv file the wrapper reads its content which will be a cli command name e.g.:

```
php71

```

and executes `php71 -v` instead of `php -v`

The commands like **php71**, **php72** and so on must be available in your system. If not, please see the installation notes #4-6 below.

If there is no PHP version specified in the .phpv, .htaccess\_dev or .htaccess file then either:

- a version specified in the PHPV\_DEFAULT env variable will be used (if exists)
- a default php version of your system will be used (if exists), e.g.: /usr/bin/php
- the **PHPV: can't find PHP CLI** error message will be thrown

---

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

[](#installation)

1. Install [composer](https://getcomposer.org/download/) if not available
2. Install the package

    ```
     composer global require orange35/phpv

    ```
3. If there are already commands like **php71**, **php72** and so on in your system then skip the steps 4-6.
4. Make sure the PATHs order is the following in your `~/.bashrc` or `~/.profile`:

    ```
     PATH=$HOME/bin:$HOME/.composer/vendor/bin:$PATH

    ```
5. Logout your bash/SSH console and log in again to execute new changes in the `~/.bashrc` or `~/.profile`.
6. Create symlinks in the `~/bin` to different php version, e.g:

    ```
     php70 -> /opt/php7.0/bin/php
     php71 -> /opt/php7.1/bin/php
     php72 -> /opt/php7.2/bin/php
     php73 -> /opt/php7.3/bin/php
     php74 -> /opt/php7.4/bin/php

    ```

Usage
-----

[](#usage)

1. go to your project

    ```
     cd ~/public_html/example.com

    ```
2. check what is php version

    ```
     $ php -v
     PHP 7.0.33 (cli) ...

    ```
3. create an .htaccess\_dev file if doesn't exist

    ```
    cp .htaccess .htaccess_dev

    ```
4. specify a PHP version in the .htaccess\_dev file

    ```
     # The next line affects the Apache +  mod_suphp configuration
     AddHandler application/x-httpd-php73 .php
     #
     # The next lines affects the Apache + php-fpm configuration

             SetHandler proxy:fcgi://php73

    ```
5. check what is php version now

    ```
    $ php -v
    PHP 7.3.9 (cli) ...

    ```

Notes
-----

[](#notes)

\***1** - The **.htaccess\_dev** file may be used (if exists) instead of .htaccess if you have the following Apache configuration:

```
    AccessFileName .htaccess_dev .htaccess

```

It is very convenient to have a development version of .htaccess file which doesn't affect the production version.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Every ~0 days

Total

2

Last Release

2419d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/142371bdccd6fca487c68463b494b6cb4d729b13503cab1c664fc7dc70a8568e?d=identicon)[orange35](/maintainers/orange35)

---

Top Contributors

[![yutv](https://avatars.githubusercontent.com/u/1616522?v=4)](https://github.com/yutv "yutv (4 commits)")[![orange35](https://avatars.githubusercontent.com/u/5397846?v=4)](https://github.com/orange35 "orange35 (1 commits)")

### Embed Badge

![Health badge](/badges/orange35-phpv/health.svg)

```
[![Health](https://phpackages.com/badges/orange35-phpv/health.svg)](https://phpackages.com/packages/orange35-phpv)
```

PHPackages © 2026

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