Documentation / Tutorials / Server
Run PHP scripts using rotating proxies
/ Server / Run PHP scripts using rotating proxies
Sometimes, we want our PHP code to run behind the proxies to hide our IP address.
This tutorial will explain how to set up rotating proxies using a bash script.
Create the PHP script which needs to be run behind the proxies.
Suppose we want to scrap the data fromexample.com and we don’t want to be banned from the example.com site server.
Create the proxy.sh file on our server file system.
make sure your index.php and proxy.sh are in the same folder.
make the proxy.sh file executable by firing this command: chmod u+x proxy.sh
to test the functionality run the proxy.sh file using ./proxy.sh command.
now our PHP script will run behind the proxy server.
This tutorial will be helpful when you are scraping big data and don’t want to get banned.