Azure Functions to execute PHP sripts/file

SoonJoo@Genting 241 Reputation points
2021-10-05T02:09:21.673+00:00

Hi I would like to execute a php file to get data from an API endpoint. The php file contains the apikey but I need a functions to execute this php file. I try to use .net with c# code to execute the php file.

But the php does not executed when I try to run php api.php in the terminal. Is there any documents I can refer to so that I can execute the php file using Azure Functions?

Thanks so much for your input!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
0 comments No comments
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2021-10-05T14:32:22.307+00:00

    @SoonJoo@Genting ,

    Azure Functions doesnt have php language handler by default. However you can use Azure Functions custom handlers, this would suit your requirement. With custom handlers, you can use triggers and input and output bindings via extension bundles.

    Please refer to the below github repository that has a php sample code running on custom handler
    https://github.com/anthonychu/azure-functions-php-worker-sample

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.