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.

kosta
  • 4,302
  • 10
  • 50
  • 104

1 Answers1

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.

Mark B
  • 183,023
  • 24
  • 297
  • 295