Skip to content

Quickly Start

axios edited this page Dec 14, 2020 · 3 revisions

Quickly initialize application

Clone from github repo

# download from github
git clone https://github.com/AxiosCros/tpr-app.git

# install libraries
cd tpr-app/ && composer install

# run cli
php tpr 

Create project by tpr-cli command

composer global require axios/tpr

# set `~/.composer/vendor/bin` or `~/.config/composer/vendor/bin` to your PATH environment variable
tpr-cli init <app-name>

Start web server

Use php built-in web server

This web server is designed to aid application development. Not recommended for use in the production environment.

start by follow command

php -S localhost:8088 -t public/

Use nginx web server with php-fpm

server {
        listen       80;
        server_name  www.test.com;
        root   "/path/to/tpr-app/public/";
        location / {
            index  index.html index.htm index.php;
            if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?s=$1  last;
                break;
            }
            #autoindex  off;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}