On my first blog, I introduced how to install WAMP server, but I didn’t say much about the configuration except changing default WAMP “www” directory. There are many detailed blogs on Internet about illustration of meaning of parameters in WAMP configurations. And documents are accessible through searching on Google. I just want to introduce some basic configuration after the complete of installation. Illustration about some configure parameters will be included.
Before we start, let’s have a look at WAMP directory:
• bin: contains binaries for Apache, MySQL, and PHP, in their respectively sub-directory. For each component, you can install multiple versions and select one of them in operation.
• apps: contains server-side tools such as PhpMyAdmin, SQL Buddy, and WebGrind.
• tools: contains client-side tool such as xdc (XDebug Client).
• www: is the apache server’s root directory.
• logs: contains apache access and error logs; and mysql log files.
• alias: contains the the apache’s alias configuration for PhpMyadmin, SQL Buddy and WebGrind.
• scripts: contains php files about WAMP server configuration.
• lang: language package
• tmp: temporary files
WAMP as a web server environment contains three parts of Apache, PHP and MySQL configuration. But first of all, it should be allowed by operating system to access localhost. I have added few lines to hosts file in Windows 7.
# localhost name resolution is handled within DNS itself.
One should run editors like notepad, ultraedit as an administrator role to modify hosts file, or it is not allowed to be modified.
Authority configuration should also be added in Apache. In httpd.conf file, the default authority setting should be looked like this:
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
# First, we configure the "default" to be a very restrictive set of
Deny from all
And I have change it as follows.
Allow from all
So Apache are accessible in its website root directory. If you specify Indexes, Apache will list the directory contents of folders which have no index file (index.html, default.html, index.php, default.asp, etc). Otherwise you will likely get an error 403 – forbidden. FollowSymLinks tells Apache to show and follow symbolic links from this directory. There are other neat options, and having AllowOverride in the httpd.conf allows you to specify which of these options can be overridden with an .htaccess file.
Order denotes which way around these rules should be applied. Order Deny,Allow tells Apache that you will specify which IP addresses to deny before specifying who has permission to access these files.
You can essentially turn on any directory options from here that you might normally include in the directories definition in the httpd.conf. This is one of the main reasons I find it helpful and most people will do to run with AllowOverride all.
At last but not least, two lines have to make sure to be uncommented which indicates the location of PHP directory.
LoadModule php5_module “[WAMPSERVER_HOME]/bin/php/php5.4.3/php5apache2_2.dll"
One thing should be noted that the DLL file for Apache 2.2 is named php5apache2_2.dll rather than php5apache2.dll and is available only for PHP 5.2.0 and later.
[Click here to learn more about Apache on Windows]
Using Apache HTTP Server on Microsoft Windows
The PHP’s configuration file “php.ini” is located at “[WAMPSERVER_HOME]\bin\apache\Apache2.2.xx\bin”. But if php.ini has other copies, the system will check php.ini file in “C:/Program Files[x86]/” first, and then in “C:/Windows/”. And the file will take into effect immediately as the system find one in those locations. DO MAKE SURE WHICH COPY IS USING before you start up your website by loading php file of with following content.
Besides that, to connect to a MySQL server, PHP needs a set of MySQL functions called “MySQL extension”. Usually, it is not necessary to load too many extensions. But two extensions are required.
And you should run WAMP server homepage to confirm that.
MySQL configuration should be taken carefully since it will affect the success of WAMP start up. The configuration file “my.ini” is located at “[WAMPSERVER_HOME]\bin\mysql\mysql5.5.xx”. I have already introduced parts of it in my previous blog of WAMP installation.
[Click here to see more introductions of my.ini parameters]MySQL:: Using Option Files
Finally, I want to introduce phpMyAdmin configuration which is a free software tool written in PHP, intended to handle the administration of MySQL over the World Wide Web. The default WAMP setting is not allowed to access phpMyAdmin. One has to edit its configuration file of phpmyadmin.conf that is located under [WAMPSERVER_HOME]\alias directory. And added same lines of as we did in httpd.conf.
Tips: How to import big sql file?
phpMyAdmin provides convenient way to immigrate to another database by importing and exporting .sql.zip/.gz files. If you are not the first creator of your blog, you may need to import sql file to get your blog run. The truth is sometimes the sql file may be too big to import. I once successfully uploaded over 360MB file which if be extracted will reach more than 1.4GB. When try to import big sql file, one may get notice like
“Script timeout passed, if you want to finish import, please resubmit same file and import will resume.”
If you look at phpMyAdmin documentation, they say you have to check three parameters of upload_max_filesize, memory_limit and post_max_size in the php.ini to see if they are larger than the size you want to upload (1.16 I cannot upload big dump files (memory, HTTP or timeout problems), retrieved from http://localhost/phpmyadmin/Documentation.html#faq1_16). And the changed parameter will appear on phpMyAdmin web page. But that’s not enough. You also need to add few lines in config.inc.php file to set timeout setting to unlimited. The default value for that is 300 second.
$cfg[‘ExecTimeLimit’] = 0;
Another way supposed can make it work is to import sql file though mysql command line by inputting command, which require no importing time limit.
mysql -u username -p databasename < mysqlfile.sql
But I never make it out. Some weird notice may come out after zip file be extracted. And I don’t recommend that way.
[Click here to learn more about phpMyAdmin configuration] phpMyAdmin 3.5.1 Documentation
[Other optional WAMP configuration topics]
PHP Short Open Tag: Convenient Shortcut or Short Changing Security?
WordPress and “You do not have sufficient permissions to access this page.”
How to change the date.timezone value in PHP?