PHP code example of oscarotero / server

1. Go to this page and download the library: Download oscarotero/server library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

oscarotero / server example snippets


//The file exists and can be served as is
if (Server::run()) {
    return false;
}

//Otherwise, go with normal php operations

//The file exists in public and can be served as is
if (Server::run(__DIR__.'/public')) {
    return false;
}

//Or include the index.php script

if ($file = Server::run(__DIR__.'/wordpress')) {
    
sh
php -S localhost:8000 server.php