开发者

Configure PHP to work with MySQL and phpMyAdmin

开发者 https://www.devze.com 2023-01-22 14:14 出处:网络
My purpose is to setup a forum in php just locally on my Windows 7 machine to test how it works. I have installed Apache HTTP Server and PHP v5 successfully. Then I downloaded and extracted the phpb

My purpose is to setup a forum in php just locally on my Windows 7 machine to test how it works.

I have installed Apache HTTP Server and PHP v5 successfully. Then I downloaded and extracted the phpbb-forum software and put it in my root folder. Then I realized that I needed some kind of database so I downloaded and installed MySQL. To configure my database I also downloaded and extracted phpMyAdmin but I can't get it to work. When I open my browser an开发者_Go百科d navigate to my phpMyAdmin-folder I simply get this:

Screenshot: http://img836.imageshack.us/img836/5139/captureqb.png

I use my Apache server to preview my website where I'm using some php include functions so I know that I've a "working" PHP installation. The MySQL service is also running on my computer.

However, do you need to configure PHP and/or Apache in order to get phpMyAdmin to work properly? I'm a complete noob on this so I suppose it may be multiple shortcomings.

Thank you.. //Realiserad


The simpler way is to install WAMP server : it bundle Apache, PHP, MySQL and PHPMyAdmin preconficurated for work together.


You need to enable the MySQL extension to use MySQL from PHP.

The MySQL extension may or may not be bundled with your PHP distribution. (look for php_mysql.dll in the ext folder)

Assuming it's installed you can enable it by adding or uncommenting this line in your php.ini:

extension=php_mysql.dll

As other people have said it may be simpler to install WAMP Server


Have a look at: http://www.ricocheting.com/how-to-install-on-windows/mysql - Specifically, the 3rd step. It involves downloading the mySQL PHP Extention (which is a dll), and un-commenting a line of php.ini so that PHP Load's the extension.

While is may be simpler to install XAMPP or WAMP, I think that it's good to know how to fix your own problems - Scientia potentia est :D


not very familiar with windows, but it seems like you miss the php-mysql extension, which you can download from here (i think): http://mysql2.mirrors-r-us.net/downloads/connector/php/index.html

would be alot easier for you to use a preconfigured wamp install like this one (available for win/mac/etc). google "xampp", i'm not allowed to post more than one link due to stackoverflows spam protection.


Configure PHP to Access MySQL

  1. Open the c:\php\php.ini file with your favorite text editor.

  2. Uncomment the following lines by removing the semicolon:

    extension=php_mysqli.dll extension=php_mbstring.dll extension=php_mcrypt.dll

  3. save and exit editor

After extracting the archive into phpmyadmin folder, you will have to configure phpmyadmin before you can connect to sql server.

  1. you should create a configuration file. This file can be created manually (simply use a text editor), During your first session you will see an error message. To solve this problem you should create folder (C:\project\wwwroot\phpmyadmin\config). After that give full rights for IIS_IUSRS group and IUSR user.granting permission/image

  2. Return to the config window. Visit localhost/phpmyadmin/setup/ To configure the connection settings click on the “New Server” button.

  3. Enter the verbose name of the SQL server, and then the server hostname. If necessary, you can specify other settings.[setting up/image][2]

  4. Save the settings and then the server will redirect us to the previous page. Choose:

the default language – English the default server – 127.0.0.1 end of the line – Windows (\ r \ n)

  1. Click Save, and then download. The received file (config.inc.php) you should save to the root directory (C:\project\wwwroot\phpmyadmin).

Open the authorization window (//localhost/phpmyadmin/) and login under root account. If you see a starting phpMyAdmin window, you can delete config folder.

For the correct work phpMyAdmin requires a database with the information. The script for creating database is already installed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号