MySQL没有使用php; 并在启用时崩溃apache
I just recently setup a fresh install of PHP, Mysql and Apache on my Windows 2003 server. Php is working fine and my Navicat MySQL browser can connect to my tables. However no matter what I do. MySQL doesn't show in phpInfo() even though I have the extensions in my ext folder. I installed PHP via the windows binary installer. Any idea what I'm missing? I'm pretty new to PHP is this is the first time I've tried to setup my own server I'm sure I'm missing something simple. Thanks.
--- EDIT ---
So as suggested by Alan Geleynse I added the extension to my php.ini, now Apache crashes every time I try to enable php_mysql.dll any ideas on this one? I may just restart my php from scratch if this is any more trouble.
我最近刚刚在我的Windows 2003服务器上安装了PHP,Mysql和Apache的全新安装。 Php工作正常,我的Navicat MySQL浏览器可以连接到我的表。 但不管我做什么。 即使我的ext文件夹中有扩展名,MySQL也不会在phpInfo()中显示。 我通过windows二进制安装程序安装了PHP。 知道我错过了什么吗? 我是PHP的新手,这是我第一次尝试设置我自己的服务器,我确信我错过了一些简单的东西。 谢谢。 p>
---编辑--- p>
正如Alan Geleynse所建议我将扩展添加到我的php.ini,现在Apache崩溃了 每次我尝试启用php_mysql.dll这个问题的任何想法? 如果这更麻烦,我可能会从头开始重新启动我的PHP。 p> div>
Seems the issue was not only a missing php_mysql.dll but I was also missing libmysql.dll The installer still borked the install of the extension files though. Oh well it happens thanks to everyone for the help.
You probably need to enable the extension in your php.ini
Search through php.ini for extension and you should see a list, some of which will be commented out. If you remove the comment for MySQL, it should load the extension.
If you do not see it, you should be able to add this line to your php.ini. Make sure that the dll listed is the one you want and is located in your extension directory.
extension=mysql.dll
Probably apache crashes because of missing dll. There is probably a directory 'ext' in your php installation dir. Check whether there is a 'php_mysql.dll' file in it. Also, check for directive 'extension_dir' in your php.ini, it must point to the location of extensions directory. For example, I have php installed in 'C:\php' and 'C:\php\ext' folder in it. My php.ini contains line:
extension_dir = "C:/php/ext"
I just fixed this problem on my computer by copying libMysql.dll from the MySql server directory to c:/windows/system32/, just a few minutes ago.