Linux下搭建风电场管理系统站点

在/etc/nginx/conf.d文件夹下新建wind.conf文件,写入以下内容:

server {
    listen 80;
    server_name wind.local;

    root /workspace/php/wind/public;
    index index.php index.html;

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

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    # 禁止访问 .htaccess 文件(Laravel默认会有)
    location ~ /\.ht {
        deny all;
    }
}

安装必须的php扩展

# 安装pdo_mysql

# 安装php-zip
apt-get install -y php8.2-zip
# 安装php-xml
apt-get install -y php8.2-xml

php设置

# 在php.ini里写入这些内容
max_execution_time = 0       ; 0 表示不限执行时间
max_input_time = 0           ; 0 表示不限输入时间
memory_limit = 1024M         ; 适当加大内存限制,防止内存不足
upload_max_filesize = 100M   ; 根据需要调整上传大小
post_max_size = 100M         ; 保持和上传大小一致或更大
# 重启php
service php8.2-fpm restart

nginx设置

# 在配置文件的location ~ \.php$里写入
fastcgi_connect_timeout 36000;
fastcgi_send_timeout 36000;
fastcgi_read_timeout 36000;
# 重启nginx
nginx -s reload

设置python脚本权限

# 进入wind/storage/app/script目录
chmod 777 module1
chmod 777 module2
上一篇
下一篇