Shutdown Computer From Mobile Using PHP/Create a Webserver in your home computer with PHP,MYSQL,APACHE in 5 Easy Steps

2:12 PM

Shutdown Computer From Mobile Using PHP


shutdown using phpOn the Internet there are some tutorials about shutting down a computer from a mobile phone.But, in this tutorial we'll check out a way to shutdown a computer from a mobile phone using PHP.For those who don't know PHP, it is a scripting language in simple words.We are PHP as it is a server side scripting language,platform independent and open source.That means we don't have to worry about whether the system runs on Windows or Linux.The procedure is really simple.All we have to do is to set up a server on the computer with PHP and execute system command to shutdown the computer.



1.SERVER SETUP 


We'll use XAMPP to set up the server.Believe me it is too easy.
 

Go to 
xampp home page.Download the available package (installer or zip archive).

Now,follow the instruction given on their site to install the server.Actually installation is just unzipping the archive to a directory.The installation will take just around 2 minute.
 

However you check my previous post on 
setting up server on home computer.


2.PHP code
 
  • After installing XAMPP, just open up XAMPP directory.Then you will locate htdocsshutdown. folder.Open that and create a new directory/folder.You can name it anything you want.Suppose the name of the new folder is
  • Open the newly created folder shutdown and create a new file withindex.php extension.
  • Now open up index.php file and place the nice little code if you run windows.
  • echo 'Shutting down'; exec("shutdown -s -t 30"); //30 means shutdown after 30 seconds ?> 
3.Creating URL 

Go to no-ip.com and register a free sub-domain and point it to the the following

http://YOUR-IP-ADDRESS/shutdown/

To find out your ip address just visit any site like http://checkmyip.com/.



That's it.Now you visit that link with no-ip subdomain from your mobile phone to shut down the computer.


This tutorial will address the basic setup of a server on your own computer running with windows platform. This means the removal of hassles of dealing with the company that is running a remote web server. It will be easy to modify. You can add any thing you want to it, be it CGI/Perl, Zope, Roxen, etc, all by your self. You will have unlimited disk space, well at least as big as your hard disk drive . Now that you know the advantages, it is time that I tell you what you will need.


You will need XAMPP 1.6.8 which is available for free & combines all of the following


* Apache HTTPD 2.2.9 + Openssl 0.9.8i
* MySQL 5.0.67
* PHP 5.2.6
* PHP 4.4.9
* phpMyAdmin 2.11.9.2
* FileZilla FTP Server 0.9.27
* Mercury Mail Transport System 4.52

STEP 1 :
1.I recommend to download Self-extracting 7-ZIP archive version because of its low size compared to other two versions.

Download Link

 
STEP 2:
After downloading extract the archiveto folder of your choice.Don't panic if it halts for few minutes at some stage (may be at 27%,32% or81%) during extraction.

 
Just be patient.

Remember that XAMPP folder will be created automatically which meansyou don't need to create one.

 
STEP 3
Now,loacate the file in the setup-xampp.bat in the XAMPP folder and run it.
You will see something like this ::




NOTE::
To start XAMPP without setup!«

If you extract XAMPP in a top level folder like c:\xampp or d:\xampp etc., you can start XAMPP directly. That means you do not need to execute the “setup_xampp.bat” at all. Apache, MySQL and Mercury Mail server will start up correctly! FileZilla FTP server will not start because it requires absolute paths. Please note: Do not use a double-xampp-folder like c:\xampp\xampp! You need a single-xampp folder like d:\xampp(\apache and so on). Otherwise you must run the “setup-xampp.bat” to set up the path configurations.


STEP 4
XAMPP control Panel

Run the file xampp-control.exe present in the folder XAMPP. The XAMPP Control Panel will appear.


To have the Apache server and the MySQL database started upon the system startup, install them as services by checking the Svc checkboxes next to them. Then ckick OK in the XAMPP Control dialog box that opens.

The Apache and MySQL servers are installed as services.

To start the Apache HTTP server, click Start.
To start the MySQL database server, click Start.


Here are some more server scripts, you might find useful:


* Apache & MySQL start: .\xampp\xampp_start.exe
* Apache & MySQL stop: .\xampp\xampp_stop.exe
* Apache start: .\xampp\apache_start.bat
* Apache stop: .\xampp\apache_stop.bat
* MySQL start: .\xampp\MySQL_start.bat
* MySQL stop: .\xampp\MySQL_stop.bat
* Mercury Mailserver start: .\xampp\mercury_start.bat
* FileZilla Server setup: .\xampp\filezilla_setup.bat
* FileZilla Server start: .\xampp\filezilla_start.bat
* FileZilla Server stop: .\xampp\filezilla_stop.bat


STEP 5
Checking XAMPP Installation

Open the URL http://localhost or http://127.0.0.1 in your browser .Click on the preferred language and you'll get this welcome screen for English.



UNINSTALLATION::
Shut down the XAMPP server and exit all panels. If you installed any services, shut them down too.
Simply delete the entire folder where XAMPP is installed. There are no registry entries and no environment variables to clean up… just simply good, clean code! Don’t forget to uninstall any services you might have installed. 

Share this

Related Posts

Previous
Next Post »

2 comments

Write comments
February 11, 2013 at 11:24 AM delete

thanks the very nice blog post shutdown computer from mobile us helpful.
Web Designing Courses In Chandigarh

Reply
avatar
July 30, 2013 at 6:20 PM delete

Great explanation and thanks for sharing this information.

Reply
avatar