tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

Deployment Methods

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-12-02 18:12:22

Deployment method

Tencent Cloud SCF provides the following function deployment methods. For more information about how to create and update a function, see Create and Update a Function.
Uploading and deploying a ZIP package, as instructed in Installing and Deploying Dependencies
Editing and deploying functions via the console, as instructed in Deployment Through Console.
Using the command line, as instructed in Deployment Through Serverless Framework CLI.

Installing and Deploying Dependencies

Currently, the SCF standard PHP only supports writing to the /tmp directory, and other directories are read-only. Therefore, you need to install, package and upload the local dependent library for use. The PHP dependency package can be uploaded with function codes to the cloud.

Locally installing dependency packages

Dependency manager

In PHP, dependencies can be managed with the composer package manager.

Directions

1. Create a local folder /code to store the codes and dependent files, and create the dependency package configuration file composer.json in the code root directory and configure the dependency information. Here takes the installation of requests as an example, and the composer.json file is as follows:
{
"require": {
"rmccue/requests": ">=1.0"
}
}

2. Run the following command in the '/code' folder to install according to the dependent package and version specified in the configuration file.
composer install
Note:
Because the function is running on CentOS 7, install the dependency package in the same environment to avoid errors. For detailed directions, see Using Container Image.

Packaging and uploading

You can upload dependencies together with the project, and use them through the require statement in function codes.
The zip package for deploying functions can be generated automatically by a local folder via the console or manually. All the packaging should be under the project directory to place codes and dependencies in the root directory of the zip package. For more information, see Packaging requirements.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백