📦 Packaging and Delivering the Application¶
Content change
The content of this page has changed from that seen in the overview video.
It has been simplified, so as to focus on the core aspects.
When you develop a web application using XAMPP, you are working on a local development server. To move the application to the client's live web host, you must package the files and database correctly and then deliver them to the client or their designated IT team for final deployment.
I. Preparation: What to Package¶
Before delivery, you must collect and prepare the three essential components of your web application.
1. Application Files¶
These are all the files located within your XAMPP htdocs folder:
- Code: All HTML, CSS, JavaScript, and PHP files.
- Assets: All images, fonts, and media files.
- Configuration: The one file (or files) that holds your application's settings.
2. Database Export¶
The client needs the structure and initial data of your MySQL database.
- Action: Use phpMyAdmin (accessible via your XAMPP control panel) to Export your database as a single
.sqlfile. This file contains the commands needed to rebuild the entire database on the client's live server.
3. Documentation & Instructions¶
This ensures the client's IT team can deploy the application correctly.
- Readme/Instructions: A simple document explaining:
- What PHP version is required.
- The steps to import the
.sqlfile. - The initial administrator login credentials.
II. Delivery Methods: Manual vs. Electronic¶
A developer will typically use one of two main methods to deliver the completed package to the client.
A. Manual Delivery (Physical/Simple Electronic)¶
This method involves creating a single deliverable package that the client handles directly.
- Packaging: Collect all application files and the database
.sqlfile into a single, compressed.zipfile. - Delivery:
- Physical: Delivering the
.zipfile on a USB drive or external hard drive. - Electronic: Sending the
.zipfile via email (only suitable for small projects) or using a secure cloud storage link (e.g., Google Drive, Dropbox). - Pros: Very simple and direct for both the developer and the client; does not require the developer to have access to the client's live server.
- Cons: Not suitable for large files; requires the client to manually manage and upload the package (which introduces risk of human error).
B. Electronic Delivery via Version Control (Best Practice)¶
For any project involving future updates or collaborative work, using a Version Control System (VCS) like Git is highly recommended.
- Packaging: Your code is already tracked within a Git repository (e.g., GitHub, GitLab).
- Delivery:
- The developer ensures all final code changes are pushed to a remote repository (e.g., the
mainorproductionbranch). - The developer delivers the client or their IT team the link to the repository and the database
.sqlfile. - Deployment Steps for Client's IT: The client's IT team can then:
- Use the
git clonecommand to download the code directly to the server. - Use the database hosting tools (e.g., phpMyAdmin or command line) to import the
.sqlfile.
- Use the
- Pros: Secure, ensures the client always has the latest version, and makes future updates simpler (
git pull). - Cons: Requires the client's IT team to have basic familiarity with Git.
III. Key Considerations for the Client's Environment¶
Regardless of how you deliver the files, you must address two key differences between your XAMPP environment and the client's production server:
- Database Connection Strings: The settings that connect the PHP code to the MySQL database (server name, username, password) will be different on the live server. You must provide the client with instructions on how to update these credentials in your application's configuration file.
- Security and Debugging: On the live server, all debugging tools and detailed error messages should be turned off to prevent revealing sensitive information to the public.