XAMPP is an easy-to-use multi-platform package that installs Apache, MySQL, PHP, phpMyAdmin, and a whole slew of other software useful for dynamic web development on your computer. Installation is painless, and configuration minimal. This page guides you through installing the package on both Windows and Mac OS X. You can also read general notes about using XAMPP.
Installing on Windows
- Go to http://sourceforge.net/project/showfiles.php?group_id=61776 and click "XAMPP Windows". If necessary, click the "1.7" link to expand the appropriate version, and choose to download xampp-win32-1.7.0-installer.exe.
- Run the installer. If you want, you can choose to install the Apache and MySQL servers as services, which will make them start automatically every time you start Windows. If you don't choose this option, you will need to use the XAMPP Control Panel application to start the servers individually each time you need them. This may be desirable if you don't intend to use your servers that often.
- Upon completion of installation, the XAMPP Control Panel will open (if not, click Start » All Programs » Apache Friends » XAMPP » XAMPP Control Panel). This tool lets you start and stop the various servers installed as part of XAMPP.
- Start Apache and MySQL by clicking on the "Start" buttons next to each item. If prompted by Windows Firewall, click the button labelled "Unblock".
- Go to http://localhost/. If you are directed to a page with the XAMPP logo, your installation was successful. Congratulations!
Here are the locations of some configuration and log files you may want to view or change:
Type | Location |
---|---|
Apache configuration | C:\xampp\apache\conf\httpd.conf, C:\xampp\apache\conf\extra\*.conf |
Apache logs | C:\xampp\apache\logs\access.log, C:\xampp\apache\logs\error.log |
PHP configuration | C:\xampp\php\php.ini |
MySQL configuration | C:\xampp\mysql\bin\my.cnf |
Installing on Mac OS X
- Go to http://sourceforge.net/project/showfiles.php?group_id=61776. Choose "XAMPP Mac OS X".
- Choose to download xampp-macosx-0.7.4.dmg.
- Double-click the Disk Image file you just downloaded.
- In the window that opens, double-click XAMPP for MacOS X.pkg.
- Once installation completes, go to your Applications folder, and go inside the xampp folder inside.
- Double-click on XAMPP Control Panel. This tool lets you start and stop the various servers installed as part of XAMPP.
- Start Apache and MySQL by clicking on the "Start" buttons next to each item. Note that you will need to repeat these steps if you reboot your computer and wish to use Apache and/or MySQL.
- Go to http://localhost/. If you are directed to a page with the XAMPP logo, your installation was successful. Congratulations!
Here are the locations of some configuration and log files you may want to view or change:
Type | Location |
---|---|
Apache configuration | /Applications/xampp/etc/httpd.conf, /Applications/xampp/etc/*.conf |
Apache logs | /Applications/xampp/xamppfiles/logs/access_log, /Applications/xampp/xamppfiles/logs/error_log |
PHP configuration | /Applications/xampp/etc/php.ini |
MySQL configuration | /Applications/xampp/etc/my.cnf |
Notes about XAMPP
Note that "localhost" (often resolving to the reserved IP address 127.0.0.1) is a special name defined in the DNS system as a name that a host uses to reference itself, using the loopback interface. URLs that refer to "http://localhost/" can only be used on the system with XAMPP installed. However, by default, XAMPP configures Apache to allow connections from outside your system, so people on your network, or in some cases users from anywhere in the world, may be able to access your Apache-served files using your IP address.You can go to http://localhost/phpmyadmin/ to use the locally-installed copy of phpMyAdmin, a tool useful for manipulating your MySQL databases in a graphical environment.
On the Windows version of XAMPP, you can use the command-line interface (CLI) version of PHP at C:\xampp\php\php.exe. On Mac OS X this is located at /Applications/xampp/xamppfiles/bin/php. If you want to be able to execute PHP by simply typing "php" at the command line in either operating system, you need to add the directory containing PHP (C:\xampp\php on Windows and /Applications/xampp/xamppfiles/bin on Mac OS X) to your "path" variable. There are tutorials available for doing this on Windows and on Mac OS X.
If you want to fine-tune your Apache, MySQL, or PHP settings, you can go to http://localhost/xampp/ to view and change parts of your XAMPP configuration. If you are feeling especially adventurous, you can also hand-tweak the configuration files in the XAMPP installation directory.
Note that XAMPP may tell you that PHP is insecure because it is not running in "safe mode". However, PHP's safe mode feature is considered a broken security measure (and has been removed in the next version, PHP 6.0) and should not be enabled.
0 comments:
Post a Comment