0

I want to launch an Amazon Linux EC2 instance and on boot-up I want to run a PHP script. I am using the AWS PHP SDK.

Referring to this, I understand that I can run a shell script by passing it as userdata. However, is it possible to run a PHP script on bootup?

What are other ways to run PHP scripts on boot-up?

PS: I am running the instance from ab AMI which already has PHP 5.4 installed.

1 Answer 1

1

Pass a Bash script in the user data, like your link describes. Have the Bash script download the PHP script from S3 and then execute it. Or you could embed the PHP script directly in the Bash script and skip the S3 part.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.