Envirornment installing
1、 Install Apache
a) If the port is being using by another web server or something, you can go the directory of the install directory of Apache and find&open the file “httpd.conf” in subdir “conf”, then find the words “Listen 80” without prefix “#”, and replace the port 80 to some other number, say 66.And then you can check if it works with url http://127.0.0.1:66.
2、 Install MySQL
a) Just install it.
b) If you wanna inport some databases or tables you can put the sql scripts into the subdir “./bin” for a while, and goto the subdir “./bin” in the command line window, then run the command like this “mysql –u root < yoursqlscript.sql”.
c)
3、 Install PHP
a) The suggestion is that you should install php with zip file:
i. Unzip the file into some place you like, say “c:/php5”
ii. To allow Apache server know how to explain php files and run as a module mode with php, you should go to the subdir “./conf” of Apache install directory and add 2 lines below at the end of the file “httpd.conf”:(And accordding to my experiences, you should absolutely point a full path name here, otherwise there will be only god knows problems.And by the way, you should need to know how to check "error.log" file in "./log" subdir to find out what's exactly going on with Apache server's starting.)
LoadModule php5_module "c:/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPINIDir "c:/php5"
iii. To allow Apache&PHP work with MySQL:first of all, you should copy all the dll files in “c:/php5” without prefix “php_” into the “c:/windows/system32” directory(Because that some extension dlls the php will load are relied on them)., second of all, you should find the line like this “;extension=php_mysql.dll”, and then get rid of “;”.But you will notice that the file “php_mysql.dll” is actually in the subdir “./ext”, so you should keep dig the “extension_dir =” line out and change it into this one “extension_dir = c:/php5/ext”.And you maybe need to unrim the following lines:"extension=php_gd2.dll"(for graphic handling of php), "extension=php_mcrypt.dll"(for phpmyadmin for some reason), "extension=php_mysql.dll" and so on and on...:)
iv. And above all, you should load some extension dlls like “php_gd2.dll”(for validation code function), “php_mcrypt.dll” and so on.
v. Restart Apache server and then try to make a “test.php” like the above and see if it works.If it works, you should see a web page like this:
b) Go to the subdir “htdocs” of Apache and create a file named “test.php”, the whole content is like this:
<html>
<head></head>
<title>The 1st php pageO(∩_∩)O~</title>
<body>
<?php
phpinfo();
?>
</body>
</html>
Then try to browse http://127.0.0.1:66/test.php, see if it works.
i. And if it works with MySQL, the page will include content like this:

ii. And if the configuration of MySQL in php.ini is all right, you should see some “mysql” lines in the page like this:

c)
4、 Install phpMyAdmin
a) Unzip the zip file to the subdir of Apache “./htdocs”, and hold all the files in the path like this “./htdocs/phpMyAdmin-3.2.4”.
b) Copy the file “config.sample.inc.php” to “config.inc.php”, and open the “config.inc.php”.
c) Goto the subdir “./libraries” open the file “config.default.php”, find the line with “$cfg['Servers'][$i]['port'] =” and add the exactly port of the MySQL server, say 3366 here, it will be like this:“$cfg['Servers'][$i]['port'] = ‘3366’”;
d) Goto the directory of PHP, and open the file “php.ini”, find the line with “;extension=php_mcrypt.dl” and chage it to “extension=./ext/php_mcrypt.dl”;
本文详细介绍了如何在本地计算机上安装配置LAMP(Linux/Apache/MySQL/PHP)环境的过程,包括解决常见问题的方法。从Apache服务器的安装到更改监听端口,再到MySQL和PHP的安装配置,以及最后phpMyAdmin的部署。

被折叠的 条评论
为什么被折叠?



