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默认的配置环境地址,重启也不会失效。

相关推荐
幻想趾于现实1 分钟前
C# Winform 入门(11)之制作酷炫灯光效果
开发语言·c#·winform
hy____1236 分钟前
类与对象(中)(详解)
开发语言·c++
wen__xvn11 分钟前
c++STL入门
开发语言·c++·算法
2301_7944615726 分钟前
多线程编程中的锁策略
java·开发语言
XYN6129 分钟前
【嵌入式学习3】基于python的tcp客户端、服务器
服务器·开发语言·网络·笔记·python·学习·tcp/ip
只有月亮知道43 分钟前
C++list常用接口和模拟实现
开发语言·c++
Epiphany心理1 小时前
R语言使用ggplot2作图
开发语言·r语言
智想天开1 小时前
10.使用路由缓存提升性能
php
Eiceblue1 小时前
.NET用C#在PDF文档中添加、删除和替换图片
开发语言·pdf·c#·.net·idea
勘察加熊人1 小时前
c#和c++脚本解释器科学运算
开发语言·c++·c#