4

I've downloaded magento ver 1.9.2.0 (latest one) from the official website magentocommerce.com/download and installed it using the standard steps. But, now the css is broken and I'm getting a plain text file. Attaching the screenshot.

screenshot

I've tried the following solutions already:

  1. Cleared the cache in var/cache folder and removed all the files from var/session folder as well.
  2. changed the permissions of media and var folders to 777.
  3. Made sure that core_config_data table has proper values for the paths:-

    web/unsecure/base_url    mystore.com/
    web/secure/base_url      http://mystore.com/
    
  4. Tried installing different theme(bluescale) but couldn't do that because the UI of our website is broken and hence, few of the buttons are not working.

  5. Tried installing magento from windows/mac laptop.
  6. Installed flash on my chrome.

I checked few more similar answers but nothing worked out so far. Please see if someone can help.

nicolallias
  • 347
  • 6
  • 19
maxomax
  • 141
  • 1
  • 4
  • Could you upload the screenshot again? Your question has good details, but it's hard to know what you are referring to without the image. – AreDubya Jul 30 '15 at 18:31
  • Sure. Added the screenshot again. – maxomax Jul 30 '15 at 19:56
  • Are you getting anything in the var/log folder? I'm assuming you have logging enabled - System -> Configuration -> Developer -> Log Settings – AreDubya Jul 30 '15 at 20:07
  • I checked, I dont have log enabled. But, with the current UI, I can't click on the "Save config" button. Clicking on this button does nothing. – maxomax Jul 30 '15 at 20:41
  • In the markup what is the path of the css that cant be loaded? – Andrew Kett Jul 30 '15 at 21:05
  • do you have css merging turned on? – Andrew Kett Jul 30 '15 at 21:05
  • follow this answer to enable logging through the database : http://stackoverflow.com/a/12043843/2813046 – AreDubya Jul 30 '15 at 21:08
  • The query retuned empty result MySQL returned an empty result set (i.e. zero rows). (Query took 0.0007 sec) SELECT * FROM core_config_data WHERE path = "dev/log/active" LIMIT 0 , 30 – maxomax Jul 30 '15 at 21:14
  • @andrewkett : I'm new to web development. I checked under system/developer/css settings Merge CSS Files is No. I didn't understand your other comment "In the markup what is the path of the css that cant be loaded? " What is markup? do you mean I should check in Firebug – maxomax Jul 30 '15 at 21:17
  • Sorry by markup I mean the HTML that is sent to the browser, e.g view source. Is it something like http://yoursite.com/media/css/60c3d5a0f66da61be37039b529747564.css or http://yoursite.com/skin/frontend/your/theme/css/styles.css – Andrew Kett Jul 30 '15 at 21:24
  • If you can, go to your core_config_data table and do an insert - scope = default, scope_id = 0, path = dev/log/active, value = 1. I think the log will be worth the trouble. – AreDubya Jul 30 '15 at 21:55
  • I've added the row in the core_config_data table. But, there is no folder created under var named log. So, the folder var/log is not there. How can I see the logs now? – maxomax Jul 31 '15 at 02:52

6 Answers6

1

Reading your question there are 2 things that come to mind, one of which happened to me today. Magento uses a full path URL to call upon CSS and JS files and it is not uncommon that it results into problems when installing Magento or moving it to another server for example.

  • Could be that merge CSS files is turned on (guess it's unlikely since you installed a fresh copy and this setting is turned of by default). In case it is turned on, turn it off and empty your cache.
  • Magento is not able properly access your media folder. Make sure the media folder that you actually have a media folder and that it is writable by the server.

I've once also encountered problems with the Fooman Speedster extension that actually creates a new folder to put a merged CSS file into. Moving your site breaks just about all your CSS and JS. Make sure it is turned of though I guess you're not working with it. Might help someone else...

Badger
  • 463
  • 5
  • 17
  • Thanks for the response. My css merging is off and the media folder is having 777 permission. Do we have to change the php.ini file? By default, the file name is php.ini.sample. – maxomax Jul 30 '15 at 21:32
  • Guess it won't have anything to do with your php.ini file. It's strange that no CSS rules are taking effect and it should definitely be a matter of its path to the sheets. What is the current path as opposed to the path it is seeking? Look at the source code... – Badger Aug 02 '15 at 08:37
  • sorry for my ignorance. I'm entirely new to web development and don't understand which path to look for and under which section of firebug (is it source, then under which folder and file). By sheets, do you mean css? – maxomax Aug 02 '15 at 11:48
  • Open firebug and look at the head section of your webpage. Look for a CSS reference (type="text/css") and check the path (that's after "href="). Maybe you can post this path here... – Badger Aug 04 '15 at 07:19
  • Thank you, I found them. Here is the complete tag- <link rel="stylesheet" type="text/css" href="mystore.com/skin/frontend/base/default/css/styles.css"; media="all"> <link rel="stylesheet" type="text/css" href="mystore.com/skin/frontend/base/default/css/widgets.css"; media="all"> <link rel="stylesheet" type="text/css" href="mystore.com/skin/frontend/base/default/css/print.css"; media="print"> . But, when I checked the css files(styles.css, print.css, widgets.css) in the source section, they all are empty. – maxomax Aug 04 '15 at 15:27
  • That pretty much says it all. Either the CSS files are indeed empty, in that case uploading them should do the trick. I assume you have done so earlier so it's likely not the case. Or the references to these files (href="mystore...") are incorrect. Are you absolutely sure your base_urls are set correctly (http://www.mystore.com/ ***Please don't forget the trailing slash since this messes up a lot of things...) – Badger Aug 05 '15 at 19:29
  • Any luck on this issue? – Badger Aug 17 '15 at 19:14
  • I added the row scope = default, scope_id = 0, path = dev/log/active, value = 1 in the core_config_data table and then deleted it and the css files were getting read but then JS files were not loading properly and I couldn't click any button in the menu tab of the admin panel. Hence finally, I had to switch to opencart. – maxomax Aug 18 '15 at 15:53
0

Have you tried copying again your default base LAYOUT and TEMPLATE to your new skin? If not, try to copy this two entire folder to your new skin. This works for me.

Donn
  • 1
0

What does your System > Configuration > General > Design look like? What is your package? Does that package have a "Default" theme? Is there anything in the Theme drop down? If you've declared a package and no Default floder CSS is there it will do this. If you've declared a package and any theme without a default folder and no named theme it will do this.

Matthew McLennan
  • 1,480
  • 4
  • 20
  • 40
0

I know you have have changed permissions on media already but the thing that I see commonly cause this is when css merging is turned on but Magento cannot write the media/css directory to cache the merged css. Another sign of this if you look at the markup the css will have a strange path, if I remember correctly it is something like /path/to/magento/media/styles.css.

Maybe just to be 100% sure this isn't the problem, make sure the media/css directory exists, if it doesn't make it. Also change it to the same user that your server is running as and make it writable.

alternatively turn merging off by setting dev/css/merge_css_files in core_config_data to 0

Andrew Kett
  • 3,488
  • 1
  • 20
  • 33
  • Merging is turned off. When I checked via firebug, my skin/frontend/rwd/defalut/css/styles.css is empty. Moreover, the media/css directory doesn't exist on my server. Shall I manually create it. And, my core_config_data table doesn't have dev/css/merge_css_files as path. – maxomax Jul 30 '15 at 21:27
  • Is defalut a typo, that should be default. Also what happens when you go directly to the CSS file URL in your browser, is it a 404. Does that file exist on your server? – Andrew Kett Jul 30 '15 at 21:45
  • Sorry, that was a typo. Yes, the css in the URL is 404 page not found. And my styles.css is empty. media/css folder doesn't exist on the server. – maxomax Jul 30 '15 at 22:05
  • Media/CSS is only used when merging is on. It should be in skin/frontend/rwd/default/css/. – Andrew Kett Jul 30 '15 at 22:17
0

Try to reupload again all files: your-magento-store/skin/adminhtml/

0

Check the Base Skin URL settings, in the admin, System -> Configuration -> General -> Web -> Unsecure|Secure -> Base Skin URL; they should be {{unsecure_base_url}}skin/ and {{secure_base_url}}skin/ on all scopes.

If that doesn't work, can you post here the requests that the browser makes to get the CSS files using the browser's developer tools? Or do a View Source on the site and post some of the <link rel="stylesheet" type="text/css" href="the interesting bit here" /> from head.

Cheers

Adi
  • 1,216
  • 6
  • 14
  • Thanks a lot for the suggestion. Base Skin URLs are correct. Here is the tag . But, I checked in the source tab-- both of the files madisonisland.css and styles.css are empty – maxomax Aug 02 '15 at 21:58
  • If you change back to the default theme, in the admin, System -> Configuration -> General -> Design -> Package -> Current Package Name = base, do the CSS files load? Can you also check the custom theme files, see if the CSS files are not empty? – Adi Aug 02 '15 at 22:07
  • Actually, the problem is that the UI buttons are not working. Whenever I try to change anything from the admin UI, and I press the button "Save config", it doesn't do anything. Is there a way to change this from the database tables? Moreover, I didn't add any theme from outside, I just used the package from magento website (magentocommerce.com/download). In default installation it shows the Current Package Name as rwd. – maxomax Aug 03 '15 at 16:37
  • Regarding using stuff from Magento Connect, here's an interesting argument: http://magento.stackexchange.com/a/40375/28733. Regarding your question, yes, you can change this from DB tables. First, can you show us the result of SELECT * FROM core_config_data WHERE path LIKE '%design%'; I suspect the theme you installed overwrote the admin theme instead of the frontend theme. – Adi Aug 03 '15 at 16:44
  • The query returned an empty result: MySQL returned an empty result set (i.e. zero rows). (Query took 0.0010 sec) SELECT * FROM core_config_data WHERE path LIKE '%design%' LIMIT 0 , 30 – maxomax Aug 03 '15 at 16:47
  • Oh! but actually I didn't install any theme. I simply used the default package(ver 1.9.2.0 ) from https://www.magentocommerce.com/download. So, it should be default theme – maxomax Aug 03 '15 at 16:49
  • Well, looking at the paths from your second comment, Magento is trying to load some rwd theme package, which probably doesn't exist. Try to replace rwd with base in app/etc/local.xml, under the design node. – Adi Aug 03 '15 at 16:55
  • Sorry, I couldn't understand when you say "under the design node" I went to this path on my server /home/myDomain/public_html/app/etc/local.xml, but couldn't find the tag for the current package name. It just has and tags – maxomax Aug 03 '15 at 17:11
  • In app/etc/local.xml look between <design> and </design>. If you don't have a <design>, then try to insert the config in the DB, with INSERT INTO core_config_data (scope, scope_id, path, value) VALUES ('default', 0, 'design/package/name', 'base'); – Adi Aug 03 '15 at 17:27
  • Thank you very much. Now, I can see base under my System -> Configuration -> General -> Design -> Package -> Current Package Name. I cleared the cache as well by deleting var/cache contents. But, do I need to do anything else because the website is still the same. And styles.css which is loaded is still empty in the firebug – maxomax Aug 03 '15 at 17:41
  • At this point I would recommend reinstalling Magento from scratch. If that's not an option, both the admin and the frontend show the same issues, with the missing CSS files? If you do a ls -lR skin/frontend or ls -lR skin/adminhtml do you see any CSS files? – Adi Aug 03 '15 at 18:15
  • yes on my server public_html/skin/adminhtml/default/default has around 9 css files. and public_html/skin/frontend/base/default/css has 3 css files. But, in the firebug, skin/frontend/base/default has 3 css files print.css , styles.css and widgets.css and all 3 of them are empty. Moreover, I've reinstalled magento around four times already. But, the same problem. – maxomax Aug 03 '15 at 18:45
  • Ok, can you check if those files are empty, on the server? find skin/ -name *.css | xargs cat. Then, check maybe the files in the downloaded package, make sure they are also not empty. When you say you re-installed Magento several times, did you re-install it from the same downloaded package? Did you clean-up everything before re-installing, files, DB etc.? – Adi Aug 03 '15 at 18:55
  • Can't edit the comment, maybe it's better to do xargs head instead of xargs cat above. – Adi Aug 03 '15 at 19:01
  • The files in the downloaded package on the server are not empty. find skin/ -name *.css | xargs cat gave the contents of the files. I downloaded the new package(from magentocommerce.com/download) every time I re-installed. By cleaning up everything, do you mean to delete everything under public_html folder and deleting and re-creating the db? – maxomax Aug 03 '15 at 23:33