PHP项目启动记录

PHP项目启动记录

  • [1. 项目整体目录](#1. 项目整体目录)
  • [2. bash_profile](#2. bash_profile)
  • [3. nginx的conf配置](#3. nginx的conf配置)
  • [4. vim /etc/hosts](#4. vim /etc/hosts)
  • [5. php -v](#5. php -v)
  • 6.修改nginx后重新加载nginx
  • [7. npm run watch-app --module=attendance --platform=mobile](#7. npm run watch-app --module=attendance --platform=mobile)
  • [8. vim ~/.zshrc](#8. vim ~/.zshrc)

1. 项目整体目录

2. bash_profile

~/.bash_profile是Mac系统中的一个配置文件,它位于用户的主目录下(例如,/Users/your_username)。

该文件是一个用于配置用户特定的Bash shell环境的脚本文件。它允许用户定义在打开终端时自动执行的命令、设置环境变量和别名,以及自定义提示符等。

本机中并未设置bash_profile文件

3. nginx的conf配置

位置: /opt/homebrew/etc/nginx/servers/coa.conf

powershell 复制代码
server {
    #监听端口
    listen    18000;

    #虚拟主机域名
    server_name  coa.com;

    #网站根目录
    root /Users/fanzhen1/Documents/chehejia_oa/public;

    #定义路径下默认访问的文件名
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$query_string;

        #打开目录浏览功能,可以列出整个目录
        #autoindex on;
    }

    #access_log /usr/local/var/log/www.test.com-access.log main;
    #error_log /usr/local/var/log/www.test.com-error.log error;

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        fastcgi_pass     127.0.0.1:9000;
        fastcgi_index    index.php;
        fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param    SCRIPT_NAME        $document_root$fastcgi_script_name;
        include          fastcgi_params;
    }
}

4. vim /etc/hosts

powershell 复制代码
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
127.0.0.1 coa.com
127.0.0.1 card-api.com

5. php -v

powershell 复制代码
php -v

PHP 7.4.30 (cli) (built: Jun  9 2022 09:20:03) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.30, Copyright (c), by Zend Technologies

6.修改nginx后重新加载nginx

powershell 复制代码
sudo nginx -s reload

7. npm run watch-app --module=attendance --platform=mobile

这个命令是使用npm运行一个脚本命令,并传递一些参数给该命令。让我们逐个解释这个命令的各个部分:

  • npm run: 这是npm的一个内置命令,用于运行项目中定义的脚本命令。在这个命令中,我们使用npm run来运行指定的脚本命令。

  • watch-app: 这是我们在package.json文件中定义的一个脚本命令。当我们运行npm run watch-app时,npm将查找并执行名为"watch-app"的脚本。

  • --module=attendance: 这是一个命令行参数,用于传递给脚本的值。在这个命令中,我们使用--module=attendance来指定一个名为"attendance"的模块。

  • --platform=mobile: 这也是一个命令行参数,用于传递给脚本的值。在这个命令中,我们使用--platform=mobile来指定一个名为"mobile"的平台。

所以,当你运行npm run watch-app --module=attendance --platform=mobile时,它会执行package.json文件中定义的"watch-app"脚本,并将"attendance"作为模块参数传递,将"mobile"作为平台参数传递。这样,脚本可以根据传递的参数执行相应的操作,例如监视"attendance"模块在移动平台上的变化。请注意,具体的脚本逻辑和行为取决于你的具体项目和脚本配置。

8. vim ~/.zshrc

mac默认的配置环境地址,重启也不会失效。

相关推荐
BingoGo2 天前
当你的 PHP 应用的 API 没有限流时会发生什么?
后端·php
JaguarJack2 天前
当你的 PHP 应用的 API 没有限流时会发生什么?
后端·php·服务端
BingoGo3 天前
OpenSwoole 26.2.0 发布:支持 PHP 8.5、io_uring 后端及协程调试改进
后端·php
JaguarJack3 天前
OpenSwoole 26.2.0 发布:支持 PHP 8.5、io_uring 后端及协程调试改进
后端·php·服务端
JaguarJack4 天前
推荐 PHP 属性(Attributes) 简洁读取 API 扩展包
后端·php·服务端
BingoGo4 天前
推荐 PHP 属性(Attributes) 简洁读取 API 扩展包
php
JaguarJack5 天前
告别 Laravel 缓慢的 Blade!Livewire Blaze 来了,为你的 Laravel 性能提速
后端·php·laravel
郑州光合科技余经理6 天前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
feifeigo1236 天前
matlab画图工具
开发语言·matlab
dustcell.6 天前
haproxy七层代理
java·开发语言·前端