Problem description:

Right after installing PMA, accessing it in Firefox shows a blank page with no output at all. In IE you can see a 500 error (Internal Server Error).

Turn on error reporting and you find this:

Warning: require_once(./libraries/common.inc.php) [function.require-once]: failed to open stream: No such file or directory in ***\mousebomb\pma\index.php on line 35

Fatal error: require_once() [function.require]: Failed opening required ‘./libraries/common.inc.php’ (include_path=’.;C:\php5\pear’) in ***\mousebomb\pma\index.php on line 35

And yet the file really does exist, and IUSR (the IIS anonymous access user) has permission on it.

Solution:

Fixing the blank page: change the relevant error output settings in php.ini. With the default php.ini, you just need to change display_error=off to display_error=on.

Fixing the require error: any file that require pulls in through a relative path starting with ./, you must grant IUSR read permission on the parent directory. This isn’t just about configuring PMA — with any site, under WIMP you have to remember that a file whose path starts with ./ can only be accessed if its parent directory is readable.

http://hi.baidu.com/ucsec/blog/item/193bc1b6e3ae98fc31add1ab.html

Sometimes after installing PHPmyAdmin, accessing it in IE gives you something like this:

Warning: require_once(./libraries/common.lib.php): failed to open stream: No such file or directory in ***\index.php on line 40 Fatal error: main(): Failed opening required ‘./libraries/common.lib.php’ (include_path=’.;c:\php5\pear’) in ***\index.php on line 40

There are a few reasons this happens:

  1. Your PHPmyAdmin directory is sitting in the root of a disk. 2. There’s a permissions problem with your PHPmyAdmin directory and its parent directories.

Fix:

· Don’t put the PHPmyAdmin directory in the root of a disk — put it somewhere like D:\SiteManage\phpmyadmin · Set the permissions on the PHPmyAdmin directory and its parent directories as follows: Users    Read & Execute IUSR_……  Read & Execute

Another fix: -----------------

I hit a strange problem. After installing phpmyadmin, I got this error: Warning: require_once(./libraries/common.lib.php) [function.require-once]: failed to open stream: No such file or directory in X:\Xxxxx\phpmyadmin\index.php on line 36 Fatal error: require_once() [function.require]: Failed opening required ‘./libraries/common.lib.php’ (include_path=’.;C:\php5\pear’) in X:\Xxxxx\phpmyadmin\index.php on line 36

I imported the MySQL database into a freshly installed MySQL 5.2, opened the blog home page, and still got a similar error.

After a round of debugging I finally found the fix: it came down to insufficient ACL permissions on the parent directories of the phpmyadmin and php install directories, hah! Give phpmyadmin, php, and their parent directories the same read permission for the ACLs user; then open the blog again — done! ^_^

Things to watch out for and security risks: 1、Don’t install phpmyadmin in the root directory of a site or virtual host, because then the guest user gets permissions on the root directory. 2、Just grant phpmyadmin read permission for the IIS worker process user and the IIS anonymous user. It’s strongly recommended not to add everyone to the ACL permission list. 3、When debugging a program or setting up a script environment, try reading the FAQ first! Then hunt for the cause in the error output… (for example, with the error above, open line 36 of index.php and see what command the PHP code is executing — the cause of the error becomes obvious)

Tips:

1、Don’t unzip and install phpmyadmin in the root directory, because then the guest user gets permissions on the root directory.

2、Just grant phpmyadmin permissions for the iis user and the user group. Adding everyone permission is not recommended.

---------

Both approaches above follow the same idea — give them a try.