• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How the Web server read and execute php File?

Status
Not open for further replies.

Parth86

Member
Hello
I don't understand basic difference, how the Web server read and execute file like php html. Web server read,processed, and deliver Web page to user. in html file server read the file and send same file to the user.
What does server do with php file?
does server send signal to physical port of pc?
Thank you very much
 

Parth86

Member
Because you don't - a PC serial port has nothing to do with PHP running on a server.
I have little bit knowledge about php. I don't understand the process how the serial port communicate with Web via php. I saw in many link that I have to configure port, open port, write to port and then close serial port. Please someone can explain how the com port communicate with Web via php
 

kubeek

Well-Known Member
Most Helpful Member
Once again, PHP cannot communicate with a serial port. The PHP web server and a serial port are two completely different and unrelated things.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
I have little bit knowledge about php. I don't understand the process how the serial port communicate with Web via php. I saw in many link that I have to configure port, open port, write to port and then close serial port. Please someone can explain how the com port communicate with Web via php
If you want to communicate to PHP via a PC serial port you need an ESP8266 serial/WiFi module (or similar).

As we've all told you, PC serial ports don't access the web.
 

DirtyLude

Well-Known Member
Not sure if this is what you are asking, but...

PHP has some extensions for COM (serial port) access. I have not used PHP in a very long time, but I used an extension in linux to access a serial port in PHP.

I quick google search finds the PHP Direct IO extension.
http://www.brainboxes.com/faq/items/how-do-i-control-a-serial-port-using-php

I assume this is for taking external data and adding it to a web page, or sending a response notice to something over serial.
 

Parth86

Member
I want to Control led via Web. I want to send switching on or off command to led via pc Web server. Led is connected to the port pin of microcontroller. I need two programs, one for computer and another for microcontroller
I need to develop Web page It's functions is to give user the choice either switch the led on or off. we can make websites in html or php. I have created Web page In html, there are two button to on or of led
I saw in many links that php script can be send information to serial ports that's why I am asking about php
Now I am confused how to send command to led via Web?
 

DirtyLude

Well-Known Member
Assuming you know how to use PHP, you need to be able to connect your microcontroller to the serial port and talk to it. I'm also assuming you have done that. Load the Direct IO extension into your web server PHP and follow the guides in that link.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
I want to Control led via Web. I want to send switching on or off command to led via pc Web server. Led is connected to the port pin of microcontroller. I need two programs, one for computer and another for microcontroller
I need to develop Web page It's functions is to give user the choice either switch the led on or off. we can make websites in html or php. I have created Web page In html, there are two button to on or of led
I saw in many links that php script can be send information to serial ports that's why I am asking about php
Now I am confused how to send command to led via Web?
As I suggested above, look up ESP8266 - which do EXACTLY what you want, from both web browsers or phones.

One (of many) places you might look for help is http://randomnerdtutorials.com/
 

Parth86

Member
As I suggested above, look up ESP8266 - which do EXACTLY what you want, from both web browsers or phones.

One (of many) places you might look for help is http://randomnerdtutorials.com/
Cost is always matter, I don't have enough money to buy module that's why I just want to do with microcontroller, I have microcontroller and pc. I think home automation via Internet can be done using pc and microcontroller. That's why I was looking the way to communication between pc and microcontroller.

I am just looking way to activate com port of pc. But you all told me that php can not use to activate serial port. So please some one can tell me what I have to do
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top