2

This is a fairly simple question, yet I haven't been able to find a simple answer.

If I use curl on Server1 to access a PHP file on Server2, is the code in that file executed on Server2?

I have a script on a remote server that I need to be able to execute from my main server. The code should be executed on the remote server where the PHP file resides.

1 Answer 1

3

Yes, it is. Same as you'd enter that address to internet browser.

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

1 Comment

Adding the usual caveat "if the server is configured to run the PHP script on access of that URL." Of course the server could be configured to just return the contents of that script. But the latter part of your answer is the key.

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.