Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: File Includes not working all the time  (Read 1186 times)

BS0D

  • Newbie
  • *
  • Karma: 0
  • Posts: 18
File Includes not working all the time
« on: August 01, 2012, 05:56:42 pm »

Hey guys,

I really need to include a file in one of my articles. At first it wasn't working, I was getting the error: "file type not allowed" or something like that.
After a little while it started working fine.

And now, back to square 1: my article displays the path to the file and the filename (major vulnerability in certain cases), and it does not actually include the content of the file.

The include function works totally randomly on my installation (1.7) and it is a bit annoying.
For the info, I am using several plugins in Firefox, but it does the same thing in all the other browsers I have tested it with -- and those do not use any plugins.

Do you know how I can fix that?

Thanks...
« Last Edit: August 01, 2012, 05:58:59 pm by BS0D »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: File Includes not working all the time
« Reply #1 on: August 01, 2012, 08:54:35 pm »

1) What's the file-type of the file you are having trouble with?
2) Is that file-type in the "allowed" list list fields in your Admin => Settings => Contents panel?
3) How are you uploading your 'included' files to your server... FTP or uploading from the admin panel to a specific folder?
4) Have you checked the permission settings on the folder (on the server) to be sure they aren't blocking access to the file?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

BS0D

  • Newbie
  • *
  • Karma: 0
  • Posts: 18
Re: File Includes not working all the time
« Reply #2 on: August 02, 2012, 06:43:23 pm »

The file is a regular .html file. I uploaded it with my FTP software, and the permissions on the folder is set to 705.

It is indeed allowed in my settings.

I haven't touched anything, it was working one day and the next it only displayed the file path... which it still does.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: File Includes not working all the time
« Reply #3 on: August 02, 2012, 07:28:39 pm »

Hi - when you say it only displays the file path, is that both in public view and admin view? In admin, as far as I recall, includes won't show - only the path/filename. So if you're seeing that when not logged in as admin then yes, something's definitely wrong.

Concerning permissions, I think the folder needs to have permissions set to 755 or 777 for includes to work. Not 100% sure though, especially since you're getting varying results. But it might be worth testing to see if there's any improvement.
Logged

BS0D

  • Newbie
  • *
  • Karma: 0
  • Posts: 18
Re: File Includes not working all the time
« Reply #4 on: August 03, 2012, 02:05:27 am »

well i put myself in quite a pickle. i messed with the permissions for one minute, and now i cant set them back to 777.
I dont konw what to do. i tried with 2 different ftp software but nothing will work.

it contains all my images and important files, but i cant even retrieve them from the server because it wont let me access it.

What do i do?!!
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: File Includes not working all the time
« Reply #5 on: August 03, 2012, 10:55:11 am »

Talk to your host support, they should be able to tell you.
Logged

BS0D

  • Newbie
  • *
  • Karma: 0
  • Posts: 18
Re: File Includes not working all the time
« Reply #6 on: August 03, 2012, 07:18:00 pm »

OK so I fixed that problem and I now have access to that folder in question.

I found a php script online to fix permissions recursively on the entire server.

Now my website gives me a 500 error:

Quote
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, postmaster@blahblahxxx.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

All my files, including the .htaccess file, are set to 644, and the folders (which i can access by typing the full path in the address bar) are set to 755.
But the website itself is inaccessible... I dont know what to do from here, I'm just getting more irritated. Any help?
Logged

BS0D

  • Newbie
  • *
  • Karma: 0
  • Posts: 18
Re: File Includes not working all the time
« Reply #7 on: August 03, 2012, 07:24:06 pm »

By the way, this is the page where i found the script: http://drupal.org/node/34028
Could it, by any chance, have modified something on my server that causes my php files not to work now?
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: File Includes not working all the time
« Reply #8 on: August 04, 2012, 12:44:22 am »

This might come across as a little blunt, or harsh, but so be it. See it as "tough love" ... just not literally... 'cause I don't know you that well. ;) Anyway, here's what I would do in your situation.

1) Talk to the webhost support and see what their take on it is.

2) If the host support is unavailable, non existent, or can't help: assuming I have a copy of all my site files and database on my computer, or external drive/cloud, I'd remove all the site files on the domain and drop the database, then do a completely fresh installation by uploading my backup files through my FTP client and creating a fresh database. After having uploaded the backup files I would also make sure that the necessary folders I will use for images and includes have permissions set to 755 (rwx-rx-rx). Permissions on other files and folders shouldn't need to be changed but those folders should, if they aren't 755 already.

I get that you want to fix the problem with as little hassle as possible. The problem is that in a situation like this, especially if you're not really sure that what you're doing is helping the situation or making it worse, chances are you'll find yourself entangled in a big ball of yarn quicker than you know, with no way out in sight. Starting over from scratch might not be the desired way to go, but it's most likely the safest way.

Now, I'm no expert in this area. And that's precisely why I'd go with option 2. After I'd tried option 1. Anyway, I hope you find a way out because it's not a fun situation to be in, and I hope I'm not sounding too harsh.

Off topic, sort of: I don't think this is caused by a bug in sNews so the topic should probably be moved to a more suitable area.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: File Includes not working all the time
« Reply #9 on: August 04, 2012, 10:14:38 pm »

Off topic, sort of: I don't think this is caused by a bug in sNews so the topic should probably be moved to a more suitable area.

Welcome back Fred! Relocated, as suggested.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU