Bookstore project using XAMPP 详细配置 Part 1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Bookstore project using XAMPP 详细配置 Part 1相关的知识,希望对你有一定的参考价值。

这是学校的一个project,记录在这里,以备复习。主要是用XAMPP通过phpMyAdmin连接mysql数据库,实现一个简单的查询功能。

Outline

  1. Setup of XAMPP
  2. Implementation of MySQL database in “phpMyAdmin”
  3. Create PHP page
  4. User interface and test cases

 

1. Setup of XAMPP

1) I downloaded the XAMPP from this link (http://www.apachefriends.org/en/xampp.html).  Since I already have IIS taking port 80, I need to modify the “httpd.conf” file by clicking on “Config” on “Apache”. Then find “Listen” to change it to 85 as the port for Apache (see line 58 in Figure 1 below).

技术分享 

Figure 1

 

2) Also I have installed MySQL before. So the port 3306 was taken. I need to setup another port for the MySQL in XAMPP. Edit “my.ini” by clicking “Config” on “MySQL”, then find “port” and change it from 3306 to 3307 (see line 20 and 28 in Figure 2 below).

技术分享

Figure 2

Here is the reference. (http://stackoverflow.com/questions/18177148/xampp-mysql-does-not-start)

  

3) After these, the XAMPP is finally set up (Figure 3).

技术分享

Figure 3

  

4) Type in “localhost:85”, it will show correctly (Figure 4).      

技术分享         

Figure 4

  

5) When I was trying to click on “phpMyAdmin”, it gave me the error message (Figure 5)

技术分享

After I did some research, I found most of the suggestions were talking about password and username settings in the “config.inc.php” file under the directory of “\xamp\phpMyAdmin”. But it’s not the case for me. What I did is to change “$cfg[‘Servers‘][$i][‘host‘]” to “127.0.0.1:3307” instead of original “127.0.0.1” (see Figure 6 and line 22 and 27 in Figure 7).

 技术分享

Figure 6

技术分享

Figure 7

Also notice that at line 22 in the file of “config.inc.php” (Figure 7), it states that the extension is “mysqli”. I was not aware of this at this stage, but it gave me a lot of trouble later in the implementation of search function of php in this assignment because “mysql” extension was used as the default method.

Also many suggest that it’s not a good practice to use “root” as the account for the database. I should avoid that in future.

Here are the references. They are not quite my case, but they helped me a lot figuring how to fix my case.

a) http://stackoverflow.com/questions/7180893/mysql-said-cannot-connect-invalid-settings-xampp

b) http://stackoverflow.com/questions/1276538/phpmyadmin-cant-connect-invalid-setings-ever-since-i-added-a-root-passwor).     

  

6) After all of these modifications, “phpMyAdmin” finally worked (Figure 8)

技术分享

Figure 8

以上是关于Bookstore project using XAMPP 详细配置 Part 1的主要内容,如果未能解决你的问题,请参考以下文章

leetcode_1052. Grumpy Bookstore Owner

parse xml document using dom method

XQuery 按升序和降序排列

pcl之using pcl in your own project

pcl之projecting points using a parametric model

Using Swift with Cocoa and Objective-C--在同个project中使用Swift和在同个project中