项目使用yii框架,为了方便将phpMyAdmin放在了项目目录下,结构如下:

结果登录phpMyAdmin的时候,却成功后默认跳转到项目首页了
查看了phpMyAdmin的源码,修改了一个配置就ok了
文件:phpMyAdmin\libraries\config.default.php,修改如下配置项
/**
* Your phpMyAdmin URL.
*
* Complete the variable below with the full URL ie
* http://www.your_web.net/path_to_your_phpMyAdmin_directory/
*
* It must contain characters that are valid for a URL, and the path is
* case sensitive on some Web servers, for example Unix-based servers.
*
* In most cases you can leave this variable empty, as the correct value
* will be detected automatically. However, we recommend that you do
* test to see that the auto-detection code works in your system. A good
* test is to browse a table, then edit a row and save it. There will be
* an error message if phpMyAdmin cannot auto-detect the correct value.
*
* @global string $cfg['PmaAbsoluteUri']
*/
$cfg['PmaAbsoluteUri'] = ' http://www.your_web.net/path_to_your_phpMyAdmin_directory/';

在使用Yii框架的项目中,将phpMyAdmin部署于项目目录下时,登录后默认跳转至项目首页。通过修改phpMyAdmin配置文件中的PmaAbsoluteUri参数,成功解决了这一问题。
205

被折叠的 条评论
为什么被折叠?



