UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Web Hosting and Domains > PHP Hosting

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 26-07-2007, 18:19
new member
 
Join Date: Jul 2007
Location: UK
Posts: 9
Question PHP and File Permissions

Hi Everyone,

I've got some PHP scripts that either create new files or edit existing ones. (These are DIY scripts and use fopen usually with the "w" parameter).

The only way I can appear to get the scripts to operate correctly is to set the file permissions to 777. Now this makes me nervous

I read that on EUKHost websites files with permission 777 are OK because the server has some sort of security mod that makes it safe (http://www.eukhost.com/support/knowl...gory/security/)

Can some from EUKHost confirm that files with permissions are OK set at 777 ?

I hope that this post will be useful to others because I have always found file permissions difficult to deal with because all web hosts seem to deal with them in different ways.

Thanks,

Matt
Reply With Quote
  #2 (permalink)  
Old 26-07-2007, 18:45
flesso's Avatar
Premium Member
 
Join Date: Mar 2007
Location: 127.0.0.1
Posts: 1,137
Send a message via MSN to flesso Send a message via Skype™ to flesso
Default

Quote:
Originally Posted by MattHawkins View Post
Hi Everyone,

I've got some PHP scripts that either create new files or edit existing ones. (These are DIY scripts and use fopen usually with the "w" parameter).

The only way I can appear to get the scripts to operate correctly is to set the file permissions to 777. Now this makes me nervous

I read that on EUKHost websites files with permission 777 are OK because the server has some sort of security mod that makes it safe (http://www.eukhost.com/support/knowl...gory/security/)

Can some from EUKHost confirm that files with permissions are OK set at 777 ?

I hope that this post will be useful to others because I have always found file permissions difficult to deal with because all web hosts seem to deal with them in different ways.

Thanks,

Matt
You should be fine with using 777 permissions on the scripts. If anyone does try to get through eUKhost have very tight mod_security rules which will stop them.
__________________
Regards,
Josh Hold

eUKhost Blog: Over 1000 Computer Related Articles to Sink Your Teeth Into!

Super Moderator

I'm only a moderator, and do not work for eUKhost in any way. Opinions expressed by me are mine only, and do not reflect those of either eUKhost or any company that may be listed above.
Reply With Quote
  #3 (permalink)  
Old 26-07-2007, 21:45
new member
 
Join Date: Jul 2007
Location: UK
Posts: 9
Default

Thanks flesso for the quick reply. I just needed to make sure I wasn't doing something stupid!

So far I'm very impressed with EUKHosts support system. A forum is always useful and the huge quantity of tutorials,faqs and guides is excellent.
Reply With Quote
  #4 (permalink)  
Old 27-07-2007, 12:31
DPS Computing's Avatar
Premium Member
 
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 4,265
Send a message via ICQ to DPS Computing Send a message via AIM to DPS Computing Send a message via MSN to DPS Computing Send a message via Yahoo to DPS Computing Send a message via Skype™ to DPS Computing
Default

Quote:
Originally Posted by flesso View Post
You should be fine with using 777 permissions on the scripts. If anyone does try to get through eUKhost have very tight mod_security rules which will stop them.
Hopefully you haven't disabled mod_security on your account have you?
__________________
David Smith
DPS Computing
http://www.dpscomputing.com (Computing, Reviews, News) - New site / new polls / new stories! With many more to follow!
NEW LAUNCH! http://djdavid.dpscomputing.com (My DJ Website)
NEW LAUNCH! http://davidsmith.dpscomputing.com (My Personal Website)
Reply With Quote
  #5 (permalink)  
Old 30-07-2007, 15:30
new member
 
Join Date: Jul 2007
Location: UK
Posts: 9
Default

Haven't deliberately disabled mod_security so it should be running by default.
Reply With Quote
  #6 (permalink)  
Old 30-07-2007, 21:18
DPS Computing's Avatar
Premium Member
 
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 4,265
Send a message via ICQ to DPS Computing Send a message via AIM to DPS Computing Send a message via MSN to DPS Computing Send a message via Yahoo to DPS Computing Send a message via Skype™ to DPS Computing
Default

Quote:
Originally Posted by MattHawkins View Post
Haven't deliberately disabled mod_security so it should be running by default.
Yes it will be then. Was just checking that your website was still secure. Unless you specifically disable mod_security using a .htaccess file it will be enabled for your account .
__________________
David Smith
DPS Computing
http://www.dpscomputing.com (Computing, Reviews, News) - New site / new polls / new stories! With many more to follow!
NEW LAUNCH! http://djdavid.dpscomputing.com (My DJ Website)
NEW LAUNCH! http://davidsmith.dpscomputing.com (My Personal Website)
Reply With Quote
  #7 (permalink)  
Old 03-01-2008, 08:17
Junior Member
 
Join Date: Jan 2008
Posts: 11
Default

Hi,

I've got:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

in the htaccess file as recommended in a sticky somewhere.

Is this OK?

I use a lot of 777 permissions and 'w' type file writes like MattHawkins.

Ron.
Reply With Quote
  #8 (permalink)  
Old 03-01-2008, 13:05
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,046
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

Quote:
Originally Posted by Coomkeen View Post
Hi,

I've got:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

in the htaccess file as recommended in a sticky somewhere.

Is this OK?

I use a lot of 777 permissions and 'w' type file writes like MattHawkins.

Ron.
Hello Ron,

777 permission is unsafe as you are allowing everyone to write on respective file or directory. 755 is safe and there should be absolutely no problem with 755
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 19:11.

 

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

knowledgebase articles

popular blog categories