If you like programming activities, you will definitely create a localhost for your website development process, before your website is ready and launched on the internet.
Here I use xampp for localhost, and for file management activities such as: editing, adding or deleting files in it, I usually use FileZila, although this method can be used manually, by going directly to the explorer folder on windows. However, how to manage files using filzila will be very interesting, namely by using an FTP server on XAMPP. Think of it as an exercise the next time you plan to upload your website to the internet. Because when your website is already on the hosting server, and live on the internet. Then you will often use FTP for file management and greatly lighten your work.
XAMPP includes a server version of FileZilla, the FTP solution I use most often. By enabling the FTP server in XAMPP and using the FileZilla FTP Client to manage files, you can simulate how to work with a real hosting server.
To make your computer act as an FTP server, there are a number of things that you must prepare.
- FileZilla FTP Server Settings
- Transfer Files To XAMPP Server
- FTP Server Trial In XAMPP
1. FileZilla FTP Server Settings
Because your computer / server will function as a file recipient, you must activate the FileZilla FTP server program first.
- Turn on / start the FileZilla server service in the XAMPP Control Panel.
- Run the FileZilla administration program by clicking the “Admin” button in the XAMPP control panel.
- The “Connect to Server” dialog box will appear, no need to change anything here, just click “OK”.
The FileZilla server page will appear as shown below:
- Now you need to create at least 1 FTP account. Click the Edit – Users (1) menu. The user management page will appear.
- Click the “Add” button (2) to create a new FTP account. Enter a name for the user (3).
- Click and check the “Password” field, and enter a password for the new user.
- Then you need to set which folders this user can access. Click the “Shared folder” menu on the left of the page.
- Click the “Add” button and select the htdocs folder in the XAMPP installation folder. This serves as the home directory for that user.
- Give full access to the user by clicking on all the options on the right.
- Click “OK” to save the job.
2. Transfer Files To XAMPP Server
The process of creating an FTP user has been completed. Now you can FTP connection to the server to transfer your website files. Here are the steps:
- Open your FTP client, and enter the connection credentials like this. I usually use FileZilla.
- If you are connecting from 1 device (on a computer with XAMPP installed), use “127.0.0.1” in the host address field.
- But if you connect from another computer, use the network hostname or IP address of the computer where the XAMPP server is installed.
- Use “21” in the port field or leave it blank.
- Enter the username and password that you created in the previous step. Click Quickconnect, your FTP client will successfully connect to the server and be in the C: \ xampp \ htdocs folder, which is the default location for the root of your website.
You can transfer your files to the server or vice versa by drag and drop. The left is your computer, while the right is the server computer. Or you can use right click on the file / folder and select upload / download. Familiarize yourself with this procedure.
3. FTP Server Trial In XAMPP
Let’s test the FTP server in XAMPP that was created. Suppose you want to upload a simple PHP script that displays the current date and day to your XAMPP server. Here’s the code:
<!-- hari.php --> <html> <head></head> <body> <h2><?php echo "Ahoy, Captain. Today is " . date("l, j F Y"); ?>.</h2> </body> </html>
- Save the file with the name hari.php
- Then upload it to the server in the C: \ xampp \ htdocs \ folder
- When your file has been successfully transferred to the server, you will be able to see it directly in your browser with the address http: //localhost/hari.php