You are viewing this HTML file from a device via LAN Create Test Page inside the root directory of htdocsįor testing purposes, we will create a sample page located in the root directory of htdocs in xampp ( C:\xampp\htdocs) namely mywebpage.html with the following content: After doing this with both processes ( Apache HTTP Server and mysqld), the processes should have now a green checked icon, for example with Apache:Īfter allowing inbound connections, you should be ready now to test from other device. In this menu, the default section General should be visible and you will find the Action sub-group, in this area select the Allow the connection option:Īnd apply changes. Select every option respectively, do right click on them and select Properties: On the Windows Defender Firewall With Advanced Security you should be able to find the Apache HTTP Server and mysqld rules. In Windows you can easily do this accesing the firewall settings and searching for the Advanced Settings menu. Allow Inbound Connections for Apache and MySQL on the FirewallĪs first step, considering that you have XAMPP already installed and fully functional on your own computer (the host), you will need to allow inbound connections to the Apache (HTTPD) and MySQL (MYSQLD) rules on the firewall of your computer. Another device to check if its working (we'll use a mobile device connected to the same Wi-Fi network).ġ.XAMPP needs to be already installed (Apache and MySQL services are not required to be installed as services).In this short article, we will explain you how to access the htdocs directory of your xampp instance from another device in the same local area network. I quoted the we can't because it's actually possible to do this in xampp, however not everybody knows how to do it. "We can't" access easily local sites from other devices, for example on mobile devices or even when you need to show your page to some workmate. If you have any questions regarding the “PHP using XAMPP” tutorial, please ask away in the comments section of this article, and we’ll have our experts answer them for you.While working on some projects that required to be tested on mobile devices (not emulated as i needed the camera), a common problem that a lot of developers have, came in. The PHP certification covers all the fundamental and advanced concepts in PHP, making your journey towards learning PHP an easy one. In this “PHP using XAMPP” tutorial, you looked into why you need XAMPP, what XAMPP is, how to install XAMPP, and finally, how to run your first PHP script on it.Īre you planning to take the plunge and do a course on PHP? In that case, Simplilearn’s PHP course would be an excellent choice. Looking forward to becoming a PHP Developer? Then get certified with the Advanced PHP Development Course. Now navigate to your browser and type in “localhost/demo/” in the address bar to view the output.Ĭongratulations, with this, you have created a PHP file and also executed the program successfully. Now, to see the script output, open the XAMPP control panel and start Apache to host the local webserver, where our script will be running.Ĥ. Inside the demo folder, create a new text file and name it “index.php” and write the following script.ģ. It’s considered good practice to create a new folder for every project you work on.Ģ. Go to “C:\xampp\htdocs” and inside it, create a folder. This is where all the programs for the web pages will be stored.ġ. In the XAMPP directory, there exists a folder called “htdocs”. Before running a PHP script, you must know where to write it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |