Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Support > php issues.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-10-2007, 01:59 PM
Senior Member
 
Join Date: Feb 2007
Posts: 110
Default How to run PHP scripts as Owner

I've just moved E.S.Photography over to my reseller account and everything worked perfectly. There is one problem however with the scripts the owners use to edit content. On my previous host PHP was able to create files and edit the files it has created. On my reseller account PHP is unable to create files even when a file of the same name doesn't exist. (note: I think your way is better for security reasons)

I can get around this by manually changing the permission of the folder in which the file is going to be created to allow Public permission to Write. The trouble is that the owner uploads files and folders and then needs to use PHP to create a new file in one of those folders, this means that I would need to manually edit the permissions each time they upload a new show.

Is there a way around this, like making the PHP script run as the Owner?

Cheers!
Reply With Quote
  #2 (permalink)  
Old 03-10-2007, 03:47 PM
Senior Member
 
Join Date: Feb 2007
Posts: 110
Default

Cancel that. I've worked out that I can run PHP scripts as owner via Cron Jobs. For the other I'll just have to get my brother (my client :p) to change the folder's permission via Filezilla when he uploads a new show.
Reply With Quote
  #3 (permalink)  
Old 03-10-2007, 06:30 PM
Administrator
 
Join Date: Mar 2006
Posts: 1,702
Default

Good to hear that. If you continue to face the problem then open a ticket on our helpdesk and one of our system admins will solve your problem.
__________________
Web Hosting UK - ASP MSSQL Hosting - cPanel Linux Hosting
AIM : webredback || msn : andrew @ webhosting.uk.com
Toll Free : 0808 262 0855
Reply With Quote
  #4 (permalink)  
Old 03-10-2007, 08:38 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Hi Falesh,
You could always use php to open an ftp connection to write permissions, write or create a file, then reset permissions on the fly if you needed to.
Reply With Quote
  #5 (permalink)  
Old 03-10-2007, 09:34 PM
Senior Member
 
Join Date: Feb 2007
Posts: 110
Default

Good idea, I'll look into that. Thanks.
Reply With Quote
  #6 (permalink)  
Old 03-10-2007, 10:14 PM
Senior Member
 
Join Date: Feb 2007
Posts: 110
Default

ftp_chmod() works like a charm, this is going to be very useful. *thumbs up*
Reply With Quote
  #7 (permalink)  
Old 03-11-2007, 06:53 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

You are welcome.
Reply With Quote
Reply

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:07 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum