Skip to main content

How to access Wamp (Apache) server from mobile?

WAMP is by default configured to permit access to only the machine on which it is running. So if you try to access it from your mobile or any other device on the network it will give you the following error :

“Forbidden You don't have permission to access /phpmyadmin/ on this server.”

 
 
To solve this you need to grant permission. For that follow the following steps:
1. Click on the WAMP icon.
2. Click on Apache.
3. Open httpd-vhosts.conf
4. Change 'Require local' to 'Require all granted'.
5. Restart your server.
Remember, when the server and the client are not the same device, you cannot access via localhost. You need the IP address of the device. For that follow the following steps:
1. Open Command Prompt.
2. Type ipconfig.
3. Read the IPv4 address under the Wireless LAN adapter Wi-Fi.
4. Use this address to access the files from the mobile browser. (Make sure you are connected to the same wireless network.)
Example: 192.168.1.5/temp/index.html

Comments

Popular posts from this blog

Create drop-down menu with image icons in Android

Hello devs! In this tutorial, we will be creating a drop-down menu on clicking a button in Android studio. Here is an image of how our menu is going to look: On clicking the hamburger icon, a vertical menu will appear with image icons of your choice. Above image is just to get an idea of what we are going to develop. Let's get started. Step 1: Open the layout file where you want the menu. Add the hamburger icon on an image button. <ImageButton android :layout_width= "50dp" android :layout_height= "50dp" android :src= "@drawable/ham" android :id= "@+id/ham" android :background= "#00000000" />  Note : #00000000 specifies 'transparent' background. Step 2: Add a vertical linear layout for the menu. Inside that, add nested linear layouts for horizontal rows. <LinearLayout android :layout_width= "wrap_content" android :layout_height= "wrap_content...

Shake a view(edit text) on incorrect input at OTP,passwords,etc (Android)

Hello devs! This is another short tutorial to show how to shake an Edit text view if the input is incorrect. Note : The tutorial assumes that you have the basic knowledge about android development. It involves the following steps : 1. Create the Edit text and cast it inside the onCreate. EditText edittext=findViewById(R.id.edit_text); Recommended : https://github.com/GoodieBag/Pinview Optional - Put the edit text inside a dialog to take an input from the dialog. 2. Write an animation XML. Here is an example: ( shake.xml ) Courtesy : https://gist.github.com/simon-heinen/9795036 <? xml version = " 1.0 " encoding = " utf-8 " ?> < set xmlns : android = " http://schemas.android.com/apk/res/android " > < rotate android : duration = " 70 " android : fromDegrees = " -5 " androi...

Open the last opened activity in Android and save values. (Android Studio)

Hello devs! This post is going to tell you a way to open the last opened activity in Android. There are cases where we keep a login for the app and we need to use that login every time we open the app. However, you see in good apps, you don't need to login each time unless you logout. Following are the ways to achieve this: 1. Firebase Auth - this is the simplest way. However, if you don't want to use Firebase or have your own API, check out the next method. 2. SharedPreferences - Following is the way to make use of that: 1. In every activity you wish to open, add the following code. @Override protected void onPause() { super.onPause(); SharedPreferences prefs = getSharedPreferences("X", MODE_PRIVATE ); SharedPreferences.Editor editor = prefs.edit(); editor.putString( "lastActivity" , getClass().getName()); editor.commit(); } This could be your MainActivity and your LoginActivity. 2. Next, create a class called a...