Wednesday, August 4, 2010

apache + mysql+php+phpmyadmin(2)

资料找的不对的话,配置一些软件环境就成了件让人头很大的事情。按照上一个帖子配置好apache和php之后,工作正常,但是在安装phpmyadmin的时候就会出现找不到extension的问题了。在综合了一下两个帖子后,最终成功解决了问题。特别注意的是php.ini要放在windows目录下,而非windows\system32。
1. From link

libmysql.dll是否真的要拷贝到c:\windows目录下呢?

很多安装PHP教程,都是教大家把php里的libmysql.dll拷贝到c:\windows目录下(有的教程会说还要把php.ini等文件拷到系统目录的,其实一个文件都不用拷贝去的。)。
是否一定要这样做呢?很多网上的帖子都是人云亦云,别人说要,他也说要。

其实用的,每次重装系统,都这样拷一遍,折腾一遍,太辛苦了。

用过APMServ这个傻瓜式安装包的朋友可能会发觉,这个东西,在第一次安装后,以后重装系统也不会重新安装的,只要运行一下主程序,就可以运行WAMP的了,不用折腾一遍的。
可能有人会认为它把libmysql.dll拷贝到c:\windows目录下了,其实不是的,不信去找一找。

既然APMServ可以做到,那么我们也可以做得,比对了APMServ和我们安装的WAMP,找到奥妙就在apache的httpd.conf配置文件。
在httpd.conf加载PHP时,大家都知道是添加这句:
LoadModule php5_module E:\server\php528\php5apache2_2.dll

可能有些朋友也知道,添加这句后,就不用把php.ini拷贝到系统目录:
PHPIniDir E:\server\php528\php.ini

现在我说说不用把libmysql.dll拷到系统目录的办法,就是在加载php5_module前,添加这句:
LoadFile "E:\server\php528\libmysql.dll"
2. Link
When you finish installing phpMyAdmin on your windows OS, you may see this error msg below your phpMyAdmin screen after you logging in. I try googling for solution and none of them working on my windows system. But i get a conclusion from those articles i read and Yes i get the solution.
First there aren’t MySQL or PhpMyAdmin prolems. it’s PHP problem that can’t load this extension. Now you can open your php initialization file “php.ini” it’s ono your php installation directory (i.e c:\program files\php\). You must make sure that php extension directory is set up at the right place, on my pc it’s on”C:\Program Files\PHP\ext”. then you can open comment on this line “;extension=php_mcrypt.dll”.
Until this step actualy i have done the right things and surely this must work, after i restart my Apache Server this isn’t progress at all . I try googling and googling but none of them solved my problem until i read article on install mysql that must put the libray on to the windows directory than i realize this is must be the solution.
I put the library on windows system (c:\windows\) not the php_mcrypt.dll but libmcrypt.dll (mine in c:\program files\php\) , restart the Apache and ….. this is SOLVED…
Phew after a night and a half day ….

No comments: