الأدلة & Troubleshooting
حلول خطوة بخطوة وأدلة التكوين وأفضل الممارسات للاستفادة القصوى من XAMPP.
دليل التثبيت
تحميل the Installer
Visit the تحميل page and select the installer for your operating system. Make sure to download from the official SourceForge mirror to ensure file integrity.
Run the Installer
Double-click the downloaded file. On Windows, you may see a User Account Control prompt - click "Yes." On macOS, drag the XAMPP icon to your Applications folder. On Linux, extract the tar.gz and run the setup script.
Select Components
During installation, choose the components you need. By default, Apache, MariaDB, PHP, and phpMyAdmin are selected. You can also include FileZilla, Tomcat, Mercury Mail, and Perl depending on your project requirements.
Choose Installation Folder
We recommend installing to the default location (C:\xampp on Windows, /opt/lampp on Linux, /Applications/XAMPP on macOS). Avoid paths with spaces or special characters to prevent permission issues.
Launch the Control Panel
After installation, open the XAMPP Control Panel. Click "Start" next to Apache and MySQL. Open your browser and navigate to http://localhost to verify everything is working.
تكوين Apache
Changing the Apache Port
If port 80 is already in use (common with Skype, IIS, or other web servers), you need to change Apache's listening port.
- Open the XAMPP Control Panel and click "Config" next to Apache.
- Select
httpd.conf. - Find the line
Listen 80and change it toListen 8080. - Also find
ServerName localhost:80and change toServerName localhost:8080. - Save the file and restart Apache from the Control Panel.
- Access your site at
http://localhost:8080.
Setting Up Virtual Hosts
Virtual hosts allow you to run multiple local websites with custom domain names like myproject.local.
- Edit
C:\Windows\System32\drivers\etc\hosts(run Notepad as Administrator). - Add a line:
127.0.0.1 myproject.local. - Open
httpd-vhosts.conffrom the Apache config menu. - Add your virtual host block with DocumentRoot and ServerName.
- Restart Apache and visit
http://myproject.local.
Database Setup & Management
Accessing phpMyAdmin
phpMyAdmin is the web-based interface for managing your MariaDB databases. After starting MySQL from the Control Panel, click the "Admin" button next to MySQL, or visit http://localhost/phpmyadmin in your browser.
Default MySQL user: root
Default password: (empty / none)
Securing MySQL Root Password
By default, the MySQL root user has no password. For local development this is acceptable, but if you want to set one:
- Open phpMyAdmin and click the "User accounts" tab.
- Click "Edit privileges" next to the root user.
- Click "Change password" and enter a secure password.
- Update the
config.inc.phpfile in phpMyAdmin to match the new password.
Importing & Exporting Databases
To import a database, open phpMyAdmin, select your database (or create one), click the "Import" tab, choose your .sql file, and click "Go." To export, select the database, click "Export," choose your format (usually SQL), and click "Go."
تكوين PHP
Editing php.ini
The php.ini file controls PHP behavior. Common changes include increasing upload limits, memory limits, and enabling extensions.
- Click "Config" next to Apache in the Control Panel.
- Select
PHP (php.ini). - Find and modify settings like:
upload_max_filesize = 128Mpost_max_size = 128Mmemory_limit = 512Mmax_execution_time = 300
- Save and restart Apache for changes to take effect.
Enabling PHP Extensions
Most common extensions are enabled by default. To enable additional ones, open php.ini, find the extension list, and uncomment (remove the semicolon from) the extensions you need. Common extensions include extension=gd, extension=intl, and extension=imap. Restart Apache after making changes.
إصلاح تعارضات المنافذ
Port conflicts are the most common issue when starting XAMPP services. Here's how to diagnose and fix them.
Apache Won't Start (Port 80 in Use)
Common culprits include Skype, Microsoft IIS, World Wide Web Publishing Service, or another Apache installation.
- 1.Check the Control Panel logs for the specific error message.
- 2.On Windows, open Services (services.msc) and stop "World Wide Web Publishing Service."
- 3.In Skype, go to Tools > Options > Advanced > Connection and uncheck "Use port 80 and 443."
- 4.Alternatively, change Apache to use ports 8080 and 4433 as described in the Apache guide above.
MySQL Won't Start (Port 3306 in Use)
Another MySQL or MariaDB instance may already be running on your system.
- 1.Open Task Manager and look for mysqld.exe processes. End any that aren't XAMPP.
- 2.Stop any other database services from the Services panel.
- 3.Or change MySQL port in
my.inifrom 3306 to 3307.
Antivirus Warnings & False Positives
Some antivirus and security software may flag XAMPP or its components as suspicious. This happens because XAMPP includes server software that opens network ports and administrative tools that can modify system files - behavior that heuristic scanners sometimes misidentify as malicious.
Important: XAMPP contains no malware, adware, or spyware.
Every release is built from publicly available source code and distributed through trusted channels. If your antivirus flags XAMPP, it is a false positive.
Recommended Actions
- Add your XAMPP installation folder to your antivirus exclusion list.
- Temporarily disable real-time protection during installation if necessary.
- Always download XAMPP from official sources to ensure file integrity.
- Verify SHA-256 checksums after downloading to confirm authenticity.
أفضل الممارسات
Keep XAMPP Updated
Regularly check for new versions to get security patches, PHP updates, and Apache improvements. Subscribe to the Apache Friends newsletter or monitor the SourceForge project page.
Use Virtual Hosts
Instead of dumping all projects in htdocs, create a virtual host for each project. This mimics production environments and makes URLs cleaner.
Backup Your Databases
Use phpMyAdmin's export feature regularly to create SQL backups of your databases. Store these backups outside the XAMPP folder in case you need to reinstall.
Never Use XAMPP on Public Networks
XAMPP is designed for local development. Default security settings are intentionally minimal. Do not expose XAMPP services to the internet without proper hardening.
Secure phpMyAdmin
If multiple users access your machine, set a MySQL root password and consider enabling authentication for phpMyAdmin via the config.inc.php settings.
Check Logs First
When something goes wrong, always check the Apache and MySQL error logs in the Control Panel before searching online. The answer is usually right there.