www PHP I/O Script to Control Arduino

Hi,
I'm looking for a php blink script to install on my Apache web server to control and fetch data from my Arduino here at home. I've searched around and haven't found anything exactly like it. The closest thing I've found is setting something up a local machine

http://www.bushveldlab.com/Bushveld_Labs/Blog/Entries/2011/3/13_Controlling_Arduino_with_PHP_in_Ubuntu.html

I don't have the programming skills to tweak this into what I need and I suspect it might be a radically different script.

This is the start of a larger project but I wanted to start with the simplest possible scenario, turn a pin HIGH and LOW. Later I'd like to do PWM and retrieve data from temperature sensors.

Anyone out there know how I can get started?

Thanks
Rich

P.S. This is my first post to this forum. I've been playing with Arduino for 10 months now and I'm blown away by how much I can do with my limited coding skills. Hats off to the Arduino community for getting me this far!

Oh and I'm using this ethernet board

PHP is very similar to C. What is it that PHP script does that you don't want? What is it that it doesn't to that you want?

Hi,

To fetch data from an arduino from what I gather from your post an external webserver means opening up your firewall and things like that that are very risky. It is better (and in my experience) easier to get the arduino POST data to the server instead. That way you dont need to open anything in your firewall or make phpscripts that should talk to your arduino. Instead you just create an ethernetshield client sketch and post your data to a web url like: http://192.168.1.200/yourphpscript.php?data=anything&data2=moreofthesame

This has been done before when working with temperature sensors...

Yes I agree, coming in through firewall gets messy and risky. So I guess my next step would be to set up the micro SD card on my Arduino to host the php page. I assume I'll need to install php on that card to be able to execute php scripts?

Thanks
Rich

I assume I'll need to install php on that card to be able to execute php scripts?

You need a PHP engine running somewhere, in order to execute PHP scripts. The last time I checked, there was no Arduino package available on the PHP site. I wonder why?

Anyone know how to install PHP on the micro SD card of the ethernet shield?

Thx
Rich

Anyone know how to install PHP on the micro SD card of the ethernet shield?

PHP is an executable. Installing it on an SD card makes no sense.

You need a server eg. apache for PHP to work. You cannot use an arduino as a php web server.

Easiest fastest way to get a php-server.

  1. Download VMware Player www.vmware.com. Install it on your PC.
  2. Download a virtual appliance with apache from www.turnkeylinux.org. Start the VMX file with Vmware player.
  3. Start coding your php-scripts, then send data from your arduino via ethernetshield to your apache server using a url like the one I wrote in the other post...

Hope this helps a bit more to explain... PHP is a completely different language from the Arduino IDE, and should not be confused with each other, and cannot interact on the same hardware. They can however interact with each other over the network using tcp/ip and http protocols to send data and parameters for example.