PHP curl code stops working after a few requests Cent OS 7 server
I created a droplet in Digital Ocean and I have a code in PHP that uses curl to scrape a specific page.
When I created the server and configured it, the code works fine, but after a few requests it stops working. The curl doesn’t respond with the correct page, looks like there was a redirect to a wrong page.
I tried to destroy the droplet and start all over again, this time I created a snapshot of the droplet with code working, again after a few requests it stops working, I tried to restore to the snapshot, but it doesn’t work. Does anyone know what is happening? I think is some wrong or missing configuration, but I don’t figure out what is wrong.
I am using CentOS 7, apache, php 7.2
P.S.: The code works fine in other server that I use in a shared server in Hostgator, and works fine in localhost, too.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.