Zydecode Studio

phpMyAdmin CSS/theme not displayed

This little bug is a pain, but luckily only shows up on certain configs…

So far, it seems to be an issue that only surfaces with Apache2.0 and PHP5, on Windows.. and is caused by the chdir(..) call - the main one being phpmyadmin.css.php. Change the “..” to your root directory, and all should be solved.

BTW - it has nothing to do with ./ syntax being used in phpMyAdmin.

11 Responses to “phpMyAdmin CSS/theme not displayed”

  1. Moszer Says:

    This is the only mention I’ve found of this bug, I guess not many of us use Windows+Apache+PHP5.

    I found three files with this call in phpMyAdmin v2.9.1.1. These were in css\phpmyadmin.css.php, setup.php and test\theme.php. I changed the (..) to “apachedocumentroot”/phpmyadmin and the themes are still not displayed correctly. Using php 5.2.0 w/ the installer from php.net, apache 2.2.3 and Windows 2K3 server.

    Any ideas?

  2. Sean Says:

    the only thing I can think of is to check that you’re using the right slashes in your path - ie: D:\docroot\phpmyadmin vs: D:/docroot/phpmyadmin.

    BTW.. check the $cfg['PmaAbsoluteUri'] value in your config.inc.php…

  3. Francesco Abeni Says:

    I found that my phpMyAdmin was not displayed correctly. It was not totally without CSS: but only a part of it showed. It followed an upgrade to my PHP installation (Windows XPSP2 + Apache 2.0.59 + PHP 5.2.1).
    I finally found that i didn’t changed session path, and Apache was not able to create session files. I solved that, and the display problem disappeared too.

  4. Reticon Says:

    Thanks for being apparently the only site on the web that has spotted this problem.

    IIS6 & PHP 5.1.1 NO GOOD. Your solution does not work either. The chdir function, which in my 10 years of php coding I have never used, doesn’t seem to be the only problem. On the main page it doesn’t even include the phpmyadmin.css.php file at all. I looked at the sessions, but they are working fabulously. What’s with the “./” stuff? I have always used “../” for dropping back one level and used “/” to drop to the root. Does that “./” actually work?

    At this point I’m going to need to start tracing the code. I’m sure glad it is free since I have to now spend so much time making it actually work.

  5. Reticon Says:

    Oh, it does include it in a css tag… of course.

  6. Reticon Says:

    FINALLY! Thanks to the answer to this problem from 2005: http://forums.kayako.com/archive/index.php/t-5819.html

    The problem is not the “..” it is the fact that for some completely unknown reason PHP requires permissions to a directory one level lower than the one you need to access for the chdir to work. Smells like bug to me… specifically dung beetle in a stock yard.

  7. Sean Says:

    heh.. thanks for coming back to drop the link to the solution. Yeah, certainly doesn’t sound much like a PHP ‘feature’ ;o)

  8. TC Says:

    Ok, dunno if I had the exact same problem as this, but phpMyAdmin was coming up pretty funky looking, and my google search yielded this page firstmost. Thing is I’m on linux. The problem here was the php session.save_path needed permissions of 777. All is well now.

  9. Candea Dan Says:

    in php5, when you use chdir you have to put a / at the end for the function to work

  10. Simone Says:

    I have meet the same problem because PHP session is not correct defined.

    Now I ave fix session path and theme is correctly displayed

    TX

  11. Frank Says:

    Had the same problem as TC (no CSS in linux). Just wanted to confirm that for me too the solution was to locate php.ini, grep the save_path and then chmod 777 the directory it pointed to. Everything is fine now.