phpenv
安装
略
composer 配置
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer self-update
参考: https://developer.aliyun.com/article/777730
hosts
127.0.0.1 www.vueadmin.com
项目
新建项目
composer create-project --prefer-dist laravel/laravel vue-admin-laravel 8.4.4
添加站点

修改站点配置
打开phpEnv\server\nginx\conf\vhosts\rewrite 目录下对应的文件, 此处为www.vueadmin.com.conf ,初始状态次文件为空,添加如下内容
location / {
try_files uriuri/ /index.php?$query_string;
}
添加一个接口
routes\api.php 添加如下内容
Route::get('test', function(Request $request, Response $response){
return $response->setContent([
'id' => 1001,
'name' => '老狼'
]);
});
启动ningx和fpm
测试
访问 http://www.vueadmin.com/api/test

|