Installing phpMyAdmin
It's time to install the product and to configure it minimally for first-time use.
Our reason for installing phpMyAdmin could be one of the following:
Our host provider did not install a central copy
Our provider installed it but the version installed is not current
We are working directly on our enterprise's web server
Note that we can dispense with the phpMyAdmin installation step, if we choose instead to install one of the AMP products that usually include phpMyAdmin as part of their offering. Further details are available at http://en.wikipedia.org/wiki/List_of_AMP_packages.
Required information
Some host providers offer an integrated web panel where we can manage accounts, including MySQL accounts, and also a file manager that can be used to upload web content. Depending on this, the mechanism we use to transfer phpMyAdmin source files to our web space may vary. We will need some of the following specific information before starting the installation:
The web server's name or address. Here, we will assume it to be
www.mydomain.com
.Our web server's account information (username, password). This information will be used either for FTP or SFTP transfer, SSH login, or web control panel login.
The MySQL server's name or IP address. If this information is not available, a good alternate choice is
localhost
, which means that the MySQL server is located on the same machine as the web server. We will assume this to belocalhost
.Our MySQL server's account information (username, password).
System requirements
The up-to-date requirements for a specific phpMyAdmin version are always stated in the accompanying Documentation.html
. For phpMyAdmin 3.4, the minimum PHP version required is PHP 5.2 with session support, the Standard PHP Library (SPL) and JSON support. Moreover, the web server must have access to a MySQL server (version 5.0 or later)—either locally or on a remote machine. It is strongly recommended that the PHP mcrypt extension be present for improved performance in cookie-authentication mode (more on this in Chapter 2). In fact, on a 64-bit server, this extension is required.
On the browser side, cookie support must be activated, irrespective of any authentication mode we use.
Downloading the files
There are various files available in the Download section of http://www.phpmyadmin.net. There might be more than one version offered here and it is always a good idea to download the latest stable version. We only need to download one file, which works regardless of the platform (browser, web server, MySQL, or PHP version). For version 3.4, there are two groups of files—english and all-languages. If we need only the English interface, we can download a file whose name contains english, for example, phpMyAdmin-3.4.5-english.zip. On the other hand, if we have the need for at least one other language, choosing all-languages would be appropriate.
If we are using a server supporting only PHP 4—for which the PHP team has discontinued support since 31st December, 2007—the latest stable version of phpMyAdmin is not a good choice for download. We can use version 2.11.x, which is the latest branch that supports PHP 4, although the phpMyAdmin team has discontinued supporting this version too.
The files offered have various extensions: .zip, .tar.bz2, .tar.gz, .tar.xz, and .7z
. Download a file having an extension for which you have the corresponding extractor. In the Windows world, .zip
is the most universal file format, although it is bigger than .gz
or .bz2
(common in the Linux/Unix world). The .7z
extension denotes a 7-Zip file, which is a format that achieves a higher compression ratio than the other formats offered; an extractor is available at http://www.7-zip.org. In the following examples, we will assume that the chosen file was phpMyAdmin-3.4.5-all-languages.zip.
After clicking on the appropriate file, the nearest mirror site is chosen by SourceForge.net. The file will start to download, and we can save it on our computer.
Installing on different platforms
The next step depends on the platform you are using. The following sections detail the procedures for some common platforms. You may proceed directly to the relevant section.
Installing on a remote server using a Windows client
Using the Windows Explorer, we double-click on the phpMyAdmin-3.4.5-all-languages.zip
file we just downloaded on the Windows client. A file extractor should start, showing us all the scripts and directories inside the main phpMyAdmin-3.4.5-all-languages
directory.
Use whichever mechanism your file extractor offers to save all the files, including sub-directories, to some location on your workstation. Here, we have chosen C:\
. Therefore, a C:\phpMyAdmin-3.4.5-all-languages
directory has been created by the extractor.
Now, it's time to transfer the entire directory structure C:\phpMyAdmin-3.4.5-all-languages
to the web server in our web space. We use our favorite SFTP or FTP software or the web control panel for the transfer.
The exact directory under which we transfer phpMyAdmin may vary. It could be our public_html
directory or another directory where we usually transfer web documents to. For further instructions about the exact directory to be used or the best way to transfer the directory structure, we can consult our host provider's help desk.
After the transfer is complete, these files can be removed from our Windows machine as they are no longer needed.
Installing on a local Linux server
Let us say we chose phpMyAdmin-3.4.5-all-languages.tar.gz
and downloaded it directly to some directory on the Linux server. We move it to our web server's document root directory (for example, /var/www/html
) or to one of its sub-directories (for example, /var/www/html/utilities
). We then extract it with the following shell command or by using any graphical file extractor that our window manager offers:
tar -xzvf phpMyAdmin-3.4.5-all-languages.tar.gz
We must ensure that the permissions and ownership of the directory and files are appropriate for our web server. The web server user or group must be able to read them.
Installing on a local Windows server (Apache, IIS)
The procedure here is similar to that described in the Installation on a remote server using a Windows client section, except that the target directory will be under our DocumentRoot
(for Apache) or our wwwroot
(for IIS). Of course, we do not need to transfer anything after modifications are made to config.inc.php
(described in the next section), as the directory is already on the web space.
Apache is usually run as a service. Hence, we have to ensure that the user under which the service is running has normal read privileges to access our newly created directory. The same principle applies to IIS, which uses the IUSR_machinename
user. This user must have read access to the directory. You can adjust permissions in the Security/permissions
tab of the directory's properties.