配置 PHP 以与 MySQL 和 phpMyAdmin 配合使用
我的目的是在我的 Windows 7 机器上本地设置一个 php 论坛来测试它是如何工作的。
我已成功安装 Apache HTTP Server 和 PHP v5。然后我下载并解压了 phpbb-forum 软件并将其放在我的根文件夹中。然后我意识到我需要某种数据库,所以我下载并安装了 MySQL。为了配置我的数据库,我还下载并提取了 phpMyAdmin 但我无法让它工作。当我打开浏览器并导航到我的 phpMyAdmin 文件夹时,我只得到:
屏幕截图: http: //img836.imageshack.us/img836/5139/captureqb.png
我使用我的 Apache 服务器来预览我的网站,我在其中使用一些 php 包含函数,这样我就知道我已经安装了“有效”的 PHP 。 MySQL 服务也在我的计算机上运行。
但是,您是否需要配置 PHP 和/或 Apache 才能使 phpMyAdmin 正常工作?我对此完全是菜鸟,所以我认为它可能有多个缺点。
谢谢.. //实现
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 and 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
更简单的方法是安装 WAMP 服务器 :它捆绑了 Apache、PHP、MySQL 和 PHPMyAdmin 预配置一起工作。
The simpler way is to install WAMP server : it bundle Apache, PHP, MySQL and PHPMyAdmin preconficurated for work together.
您需要启用 MySQL 扩展才能从 PHP 使用 MySQL。
MySQL 扩展可能会也可能不会与您的 PHP 发行版捆绑在一起。 (在 ext 文件夹中查找 php_mysql.dll)
假设它已安装,您可以通过在 php.ini 中添加或取消注释此行来启用它:
正如其他人所说,安装 WAMP 服务器
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:
As other people have said it may be simpler to install WAMP Server
看一下: http://www.ricocheting.com/how- to-install-on-windows/mysql - 具体来说,是第三步。它涉及下载 mySQL PHP 扩展(这是一个 dll),并取消注释 php.ini 行,以便 PHP Load 成为扩展。
虽然安装 XAMPP 或 WAMP 可能更简单,但我认为知道如何解决自己的问题是件好事 - Scientia potia est :D
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
对 Windows 不太熟悉,但似乎你错过了 php-mysql 扩展,你可以从这里下载(我认为):
http://mysql2.mirrors-r-us.net/downloads /connector/php/index.html
使用像这样的预配置 wamp 安装会更容易(适用于 win/mac/etc)。 google“xampp”,由于 stackoverflows 垃圾邮件防护,我不允许发布多个链接。
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.
配置 PHP 以访问 MySQL
使用您喜欢的文本编辑器打开 c:\php\php.ini 文件。
通过删除分号来取消注释以下行:
扩展名=php_mysqli.dll
扩展名=php_mbstring.dll
extension=php_mcrypt.dll
保存并退出编辑器
将存档解压到 phpmyadmin 文件夹后,您必须先配置 phpmyadmin,然后才能连接到 sql server。
您应该创建一个配置文件。该文件可以手动创建(只需使用文本编辑器),
在第一次会话期间,您将看到一条错误消息。
要解决此问题,您应该创建文件夹(C:\project\wwwroot\phpmyadmin\config)。之后,为 IIS_IUSRS 组和 IUSR 用户授予完全权限。授予权限/图像
返回到配置窗口。访问 localhost/phpmyadmin/setup/
要配置连接设置,请单击“新服务器”按钮。
输入 SQL 服务器的详细名称,然后输入服务器主机名。如有必要,您可以指定其他设置。[setting up/image][2]
保存设置,然后服务器会将我们重定向到上一页。选择:
默认语言-英语
默认服务器 – 127.0.0.1
行尾 – Windows (\r\n)
打开授权窗口(//localhost/phpmyadmin/)并以root帐户登录。如果您看到启动 phpMyAdmin 窗口,您可以删除 config 文件夹。
为了正确工作,phpMyAdmin 需要一个包含该信息的数据库。用于创建数据库的脚本已经安装。
Configure PHP to Access MySQL
Open the c:\php\php.ini file with your favorite text editor.
Uncomment the following lines by removing the semicolon:
extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
save and exit editor
After extracting the archive into phpmyadmin folder, you will have to configure phpmyadmin before you can connect to sql server.
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
Return to the config window. Visit localhost/phpmyadmin/setup/
To configure the connection settings click on the “New Server” button.
Enter the verbose name of the SQL server, and then the server hostname. If necessary, you can specify other settings.[setting up/image][2]
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)
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.