Maginot, PHP and CHMOD

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Maginot, PHP and CHMOD

Postby Spunkmeyer » Wed Mar 21, 2007 6:34 pm

I was going through my Maginot slice profiles today, changing their extensions from shtml to PHP, so I could include some menus throughout my entire site. Anyways, when i first went into the profile settings for the areas in question, I assumed I could simply changed the file extension from *.shtml to *.php and it was going to be all good. Unfortunately, when the page was generated, it did so with a 500 error (repeatedly). Odd, I thought. So I looked into it a little further. I checked out the code from the generated page, and it all looked good, but still had the old
Code: Select all
<!--#include virtual="/comments/counter/iSayCommentCount_<Field: newsid>.txt"-->
near the bottom for the comments. I though that since I was using PHP pages, this probably wasn't going to help anything and changed it to
Code: Select all
<?php include('http://www.advocatusdiaboli.ca/comments/counter/iSayCommentCount_<Field: newsid>.txt');?>
to make sure. (obviously this would never make any difference, except to not allow the SSI to work)

So, my next idea was to copy the generated code into dreamweaver and create a test.php page to see if the error was replicated. Interestingly, it didn't generate an error, so I knew the generated code from Coranto was good. I probably should have realized it earlier, but the error had to have something to do with accessing the file and not the code itself. So i went back into the settings for the slice profile and took a look at the default CHMOD settings applied to the file output. 666, or read/write for owner, group and world. That was fine, and shouldn't have caused any real problems...(I later figure out it does)

What the hell was causing the error? I went into my FPT client and logged onto my sever and double checked the CHMOD settings for one of my working php pages, and it was set to default at 644, or read/write for owner, read for group and world. I decided to apply these settings to my Maginot slice settings, and it worked fine.

Just to double check I wasn't being an idiot, I uploaded a test.shtml page and chmoded it to 666, and then accessed it without any problems. Was there some kind of issue with CHMOD and PHP file extensions? After a little research, it turns out that servers specifically won't run PHP files that are chmoded to 666, even if you are the owner.

Anyways, If you're setting up a Maginot slice, and want your file extension to be *.php and you discover you're having problems, make sure you set the default CHMOD (666 - rw-rw-rw), to something like 644 (rw-r-r), or whatever equivalent you want to use, oherwise you'll run into problems.
"God Bless the Portable Grassy Knoll"
Spunkmeyer
 
Posts: 69
Joined: Wed Jan 10, 2007 4:36 pm
Location: Whistler, BC, Canada

Postby SrNupsen » Wed Mar 21, 2007 6:57 pm

Thanks for the write-up - sounds very familiar; I discovered this the hard way myself a couple of months ago :wink:
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Spunkmeyer » Wed Mar 21, 2007 7:04 pm

Yeah, well actually it was fun trying to diagnose the issue. Pretty much as soon as you see a 500 error, it's a pretty clear indication that it's a chmod/permission error of some kind. The only reason I didn't think about it at first was cause I never uploaded anything, and it was actually Maginot/Coranto that did it for me.
"God Bless the Portable Grassy Knoll"
Spunkmeyer
 
Posts: 69
Joined: Wed Jan 10, 2007 4:36 pm
Location: Whistler, BC, Canada


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 2 guests

cron