[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

WAMP phpmyadmin css problem

Posted on 2006-05-04
9
Medium Priority
?
1,244 Views
Last Modified: 2013-12-12
I have installed WAMP 1.6.1 on my new laptop (CoreDuo Dell) and I've installed this package on 7 computers now, with no issues.  For some reason on this laptop, the phpMyAdmin installation is throwing the following PHP error to the log:

Warning: require_once(./libraries/common.lib.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\phpmyadmin\css\phpmyadmin.css.php on line 7

Fatal error: require_once() [function.require]: Failed opening required './libraries/common.lib.php' (include_path='.;C:\php5\pear') in C:\wamp\www\phpmyadmin\css\phpmyadmin.css.php on line 7

The result is purely asthetic.  phpMyAdmin seems unable to process it's dynamic CSS calls in phpmyadmin.css.php and what the browser renders appears to be an un-stylized version of phpMyAdmin.

I have attached a screenshot here:  http://www.jookyworld.com/files/phpmyadmin.jpg

All the pretty tabs are gone, and the layout is horrible making it painful to navigate and browse.  Functionally it works, but it's just plain ugly and not very user friendly.  I have tried everything from reinstallation to renaming the directories to specifying the doc_root in php.ini (thought maybe that WAMP was having an issue with it's aliasing).  The only clue I have to the problem is that on the index.php page located in the root web directory of the installation (by default c:\wamp\www\index.php).  Usually when this file is run, you would get the contents of the root directory, but for some reason I see the contents of the following directory (c:\wamp\apache2).  

Here is the code from that index.php file:  http://jookyworld.com/files/index.txt

Where lines 180-200 (copy and paste the code into dreamweaver) spit out what is supposed to be the root web directory but instead results in the apache2 directory.  I had read where possibly apache server was compressing the phpmyadmin.css.php file using gzip and that was causing issue, but I don't know enough about Apache server to use anything I found concerning that.

Ahh the price of beauty.  Thanks in advance.
0
Comment
Question by:c2tech
  • 5
  • 4
9 Comments
 
LVL 9

Accepted Solution

by:
LinuxNubb earned 1500 total points
ID: 16606006
A few things to check:
File permissions on all files and directories are ok?  

Trying copying all files from a known working system, to the directory on this pc causing the issue.  Possible file corruption somewhere?

Re-download the installer and try again.

When you uninstall/remove, make sure the php.ini file in the c:\windows directory is removed as well.
0
 

Author Comment

by:c2tech
ID: 16607401
I checked file permissions on the directories, they match a working system.  I did try the copy/replace from a working system and got the same result.  I also tried a new installer.

Since this is a WAMP pre-packed system, it puts the php.ini file into c:\wamp\Apache2\bin\  and I did make sure that those folder were removed before the reinstall.  I confirmed this location using phpinfo().  I also went thru the registry and removed any "wamp" specific entries.  

I'm thinking this is an Apache/PHP issue, and I am unfamiliar with Apache.  In Win2K3, you append your working PHP folder to the "Path" in Environment Variables.  Are you aware of the Apache equivalent?  This may help trouble shoot.  I thought maybe it would be found in the httpd.conf file, but I didn't see anything out of order.

Thank you for the response.  I hope this additional information helps someone.
0
 

Author Comment

by:c2tech
ID: 16607567
It is important to note that the entire installation functions properly: ie, it handles PHP files properly, MySQL functions  and other server duties.  There is simply a lack of CSS handled by the phpmyadmin.css.php file that is throwing the error.  The phpmyadmin.css.php is a php file that dynamically generates the CSS based on user selected preferences.  The first 5 lines of the offending file are as follows:

<?php
/* $Id: phpmyadmin.css.php,v 2.83 2006/01/14 20:20:13 cybot_tm Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:

chdir('..');
define( 'PMA_MINIMUM_COMMON', TRUE );
require_once('./libraries/common.lib.php');

The location of the phpmyadmin.css.php file: c:\wamp\www\phpmyadmin\css
The location of the file (common.lib.php):      c:\wamp\www\phpmyadmin\libraries

As you can see it is chdir one level up and then looking for the file.  I tried integrating the level change in the require_once call, and had no effect.  I could however change the call to an absolute address(http://localhost/phpmyadmin/libraries/common.lib.php) with success, but ultimately this led to a spaghetti code effect where every file accessed after that needed absolute referencing.  Maybe this will help.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:c2tech
ID: 16607929
I found a work around.  Rather than fighting the horse to water, I brought the water to the horse.  The index file indicated above led me to believe that the phpmyadmin.css.php file felt it was in c:\wamp\Apache2 so I coded the chdir call to reflect that change:

chdir('../www/phpmyadmin/');
define( 'PMA_MINIMUM_COMMON', TRUE );
require_once('./libraries/common.lib.php');

Now CSS works.  This is kind of a dirty workaround, as it appears my server is still telling PHP files that the root is c:\wamp\Apache2 when it should be c:\wamp\www   : I confirmed that the httpd.conf variable DocumentRoot was equal to the www path, and that the ServerRoot was the Apache2 path.  Not knowing much about Apache, I changed the ServerRoot variable to match the DocumentRoot variable, and of course this brought the server down.

Perhaps a moderator could move this to the WebServers category, since I have apparently targeted the problem, and found a cheap workaround.  I hope this info helps someone else in the future, and feel free to take a crack at a more robust fix for points.
0
 

Author Comment

by:c2tech
ID: 16607957
I also changed the line 194 in the provided index.php to read:

$handle=opendir("..\www");

where before it was just "."

I'm thinking this whole thing is just some unique glitch, since I've had no problems with WAMP server before.
0
 
LVL 9

Expert Comment

by:LinuxNubb
ID: 16608747
Interesting on why the path's would be messed up on this 1 system though.

Hmmmm......
0
 

Author Comment

by:c2tech
ID: 16608999
If you have any ideas as to something in Apache or PHP files that specify the root directory, other than the one's I've already listed, let me know, I'd still like to solve this issue in a cleaner manner.

Thanks for checking back.
0
 
LVL 9

Expert Comment

by:LinuxNubb
ID: 16609106
See if these are set correctly in httpd.conf:

// this is the default root of apache, where conf, error, dtdocs reside
ServerRoot "C:/Program Files/Apache Group/Apache2"  

// the root of the web server
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"

// This should be changed to whatever you set DocumentRoot to.
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">

Other than that, you may want to run this by the experts in the Apache section, see if they know the answer.

LN
0
 
LVL 9

Expert Comment

by:LinuxNubb
ID: 16651511
What fixed this, or did you get this fixed (just curious...)??
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question