Download the PHP package natanfelles/php-server without Composer

On this page you can find all versions of the php package natanfelles/php-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-server

PHP Server

Latest release PHP version Packagist downloads

Fine-tuning on the PHP built-in web server

PHP Built-in web server autoindex

See release notes at: https://github.com/natanfelles/php-server/releases

Installation

Composer

Open your terminal and run:

Add the composer bin path to your .bashrc:

Run:

Manual

Download and extract the php-server project folder.

Add the php-server alias to your .bashrc:

Run:

Config

You can run the php-server in any folder of your operating system.

Each time you run the php-server command, it will look up if there is a file named php-server.ini in the current directory. If found, your settings will override the default settings.

A quick example file content is:

You can use the command php-server new to create a new configuration file in the current directory.

Explanation

General Vars

Key Default Value Description
php PHP_BINARY PHP binary path or command
host localhost Server host
port 8080 Server host port
root getcwd() Document root. The location that will be the public root of your website.
autoindex true Determines if the server will list directory contents if it does not find an index file.
index index.html index.php The names of the index files separated by spaces.
error_reporting E_ALL Sets the level of errors that will be reported.

Sections

Section Description
ini Used to set custom php.ini directives.
server Used to set custom Server and execution environment information.

Knowing this, just create (if necessary) a php-server.ini file, run the server and you're done.

Run

As you can see in the config. You can create a php-server.ini file to leave the settings of each project already pre-established.

But, you can also simply run php-server and the server will already be available at http://localhost:8080.

The php-server command can receive some parameters and they are:

Parameter Description
--php PHP binary path or command
--host Server host
--port Server host port
--root Document root

For example, to run the server on a different port:

Or, also with a different version of PHP than the default:

Right. You get the idea. If you want to run on a different host you can add the host to the hosts file of your operating system.

Contribute

Hello, how nice that you are reading this.

If you have any idea to improve this project or something is not working as it should, do not hesitate to open an issue and if you have solved the problem feel free to open a Pull Request.


All versions of php-server with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package natanfelles/php-server contains the following files

Loading the files please wait ....