How to run a PHP script outside browse (without browser)


Recently I am working a project where I need to execute a PHP page every hour to scrap data from another web URL and store the information to MySQL database. To accomplish that, I have faced some challenges:

1. How can I execute PHP script without browser

2. How can I do the cronjob

Hmm..seems problems are not big! really?

For cronjob, I can use windows scheduler, but for several reasons, I was unable to do so. Later I have found a software, named pycron which format is exactly same with crobtab of unix system. Ok, cronjob problem is solved, now the big question, execute PHP script outside browser. Its simple actually!
Use PHP binary path (in my case, C:\wamp\bin\php\php5.2.6\php.exe) to execute the php page. PHP page format should be real path (in my case, C:\wamp\www\dc\temp_cap.php). Its done!

So, in pycron, you should use binary path as command and PHP…

View original post 41 more words


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s