What is XAMPP?
From the http://www.apachefriends.org Web site:
“Many people know from their own experience that it’s not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl.
XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use – just download, extract and start.”
Install XAMPP
Linux Users
- These instructions focus on installing for Windows.
- Linux users may want to check out IBM’s page on the subject. Their installation page even includes an example of accessing a database using the PHP Pear library which is included with the XAMPP install:
- http://www-128.ibm.com/developerworks/linux/library/l-xampp/
Windows Users
- The XAMPP install tries to install to port 80. If MS-IIS is running on the server, set it’s port to 81 before running the XAMPP installer.
- Go to http://www.apachefriends.org download and run the Windows installer.
- When installing, just leave the defaults. I recommend NOT checking the option to run the applications as services during install. That’s because when I did check those options, I got an error that Apache and Filezilla couldn’t install because the ports were busy. I think it was just tripping over itself. I had to reboot and run the XAMPP console to try again – then it worked.
- Launch the XAMPP console (there should be an icon on your desktop).
- For Apache, MySQL and FileZilla, check the “Svc” option on the right. FileZilla will start automatically. Click the Start button for the other two services.
- Make sure there are no errors in the console.
- Click on the Settings… button and check Enable the XAMPP Service, check the Apache, MySQL and FileZilla modules and clik OK
- Visit http://localhost to configure your server.
- Follow the recommendation to check the Status and verify that everything is working.
- Make sure you visit http://localhost/security/index.php and secure your server. There should be a link and / or suggestion on the page for resolving each unsecure issue.
- Once a XAMPP username and password is in place you’ll need that to visit the root of http://localhost. When you get prompted with the browser password dialog, enter the username and the password that you assigned to the XAMPP directory. You can make your life easier by checking the part about remembering your password (if that’s an option).
- To secure FileZilla, launch the Admin from the XAMPP console. Then under Edit / Users change the password for newuser. Then revisit http://localhost/security/ and make sure that FileZilla is now secure.
- If this is a development machine, the XAMPP page suggests that you just leave PHP unsecure.
If Apache Won’t Start …
On one machine with a fresh install of XP I ran into a problem where Apache wouldn’t start. I was getting this error:
The Apache service named reported the following error:
>>> (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted.
: make_sock: could not bind to address 0.0.0.0:443
- Edit file: xampp\apache\conf\extra\httpd-ssl.conf
- Change the Listen port to 444
- Restart the service
- If for some reason port 444 is also not available, keep upping the port number until you find a free port.
In case you didn’t know, by default the first non-secure Web server on a machine usually listens on port 80. The first secure server usually listens on port 443. Web masters are free to change the port as they see fit. In fact you will have to if there is a conflict as in the case above. But visitors browsing the site will need to integrate the port into their URLs. For example, if you install Apache on port 80, and Microsoft IIS (MS-IIS) on port 81, users will need to include port 81 in their URL’s to visit the MS-IIS server like this: http://www.yourdomain.com:81/. If you don’t include the port for a non-secure URL, the browser will assume it needs to access the server on port 80. For a secure connection (https) the browser will assume port 443 by default.
If that doesn’t work …
Try running xampp\apache_start.bat and see what you get for an error message.
In one case of upgrading XAMPP, I got this error message:
httpd.exe: Syntax error on line 478 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 7 of C:/xampp/apache/conf/extra/httpd-xampp.conf: API module structure ‘php5_module’ in file C:/xampp/apache/bin/php5apache2.dll is garbled – expected signature 41503232 but saw 41503230 – perhaps this is not an Apache module DSO, or was compiled for a different Apache version?
I fixed it by updating the reference in xampp\apache\conf\extra\httpd-xampp.conf to point to the 2.2 file:
LoadModule php5_module “C:/xampp/apache/bin/php5apache2_2.dll”
configure http-xampp.conf
To create virtual directories for Apache
- Edit file: xampp\apache\conf\extra\httpd-xampp.conf
- Add aliases like this just above the aliases for other directories, such as /security and /phpmyadmin:
Alias /webapps "C:/devmca/webapps/"
<Directory "C:/devmca/webapps">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
Alias /phpbb2 "C:/phpBB2/"
<Directory "C:/phpBB2">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
configure php.ini
- Edit file: xampp\apache\bin\php.ini
- Update SMTP Settings (adjust for you settings, if known):
[Date]
; Defines the default timezone used by the date functions
date.timezone = America/New_York
[mail function]
; For Win32 only.
SMTP = smtp.yourdomain.com
smtp_port = 25
; For Win32 only.
sendmail_from = mallen
Windows Firewall Issues
If you install under Windows XP and have the Windows Firewall running, you will probably need to open up the ports for your Web and FTP server. It may work fine if you run a test from the server where you installed XAMPP. But if other machines can’t browse to your Web server and FTP times out it’s probably a firewall issue.
- Start > Control Panel
- Double-click on Windows Firewall
- If you are having a problem, the firewall will most likely be in the On position – leave it as is.
- Click on the Exceptions tab
- Use the Add Port … button to open up ports 80 and 21 – unless of course you set your Web server and FTP server to listen on different ports
See also …
You may also find this link helpful: http://www.keitr.com/tutorials/xampp
Tags: Apache, Linux, Windows, XAMPP