How do I upload PHP file to root directory?

How can I upload a PHP file to my root directory on my shopify website?

I am using anyimage.io that will allow me to embed a link in the image. When I tweet the link and someone clicks on the image, it will direct them to my website, In order for it to show my website name on the image, I must have the PHP code on my site so to verify that it’s not a malicious tweet. I can upload to my folders on my account, but I know this is different. How can I install a PHP file into my root directory.?

I’ve attached a screenshot of the code if this helps anyone.

Shopify is a managed platform that is not PHP based and you cannot access to the root directory to upload custom files.

From their website:

https://anyimage.io/faq/what-is-custom-domain
NOTE: Some web providers, such as Shopify and Wix, do not allow custom files to be uploaded. If you’re not able to upload third-party files, then you will not be able to use a custom domain, however, you will still be able to use a custom subdomain.

1 Like