Dotable - the home of "No worries" hosting!  
 
Home About Products F.A.Q Network Status Affiliates Support Contact Search Terms
Welcome to Dotable. Dotable currently hosts more than 15,000 domains for clients in all corners of the globe, so we must be doing something right! Dotable is all about people, and without people Dotable would not be where it is today. We value our clients and work hard with them and for them, so they can achieve their online goals. Our client's success is our success. Dotable's staff has more than 40 years of combined experience in hosting. Our products range from single domain hosting, through to fully managed dedicated servers. We invite you to inspect our products from the links below. We're here to serve you so sing out if you need anything. Welcome to Dotable!
Host one domain Multiple domains Reseller accounts VPS accounts Dedicated servers Register domains Backup space
Go Back   Dotable - Dot your Domains > Dotable Support Forum
Reply
 
LinkBack Thread Tools Display Modes
Old 4th June 2006, 11:22 AM   #1 (permalink)
New Dotable member
 
Join Date: May 2006
Posts: 22
Default Php Questions

Ok,

I have a few php related questions, and i will put them all in this post to keep things together. (if thats a bad ideas and i should post the indivdual questions separately, just say so). I realize that all hosts need to find a balance between security and functionality, so this is mostly just an attempt to find out more about how 'dotable does php'...

1.Ownership, Groups & Users...
When a file/directory is created by php or apache, which user (and group) owns it...Or maybe its better to ask which user is apache (and or php) running as?
Conversely, if i create a file/directory is there a group that apache/php are in that i can give permission to so that apache/php can write to or read from, without having to 777 the file/directory.

2. Custom PHP ini?
With other hosts i usually used the following script to add some custom php configurations (from B&T)
HTML Code:
<?php
// Put all the parms you want to change below.  Follow the examples below, incrementing the array key for each parm.
$parm[1] = "register_globals = OFF \n";  // register globals off
$parm[2] = "session_transid = 0 \n ";
$parm[3] = "upload_tmp_dir = /home/" . get_current_user() . "/tmp/uploads/ \n";   // user specified temp upload directory 
$parm[4] = "post_max_size = 8M \n";   // user specified post max size
$parm[5] = "upload_max_filesize = 8M \n";   // user specified post max size
$parm[6] = "error_log = /home/" . get_current_user() . "/logs/php.err \n";
$parm[7] = "zend_extension = /home/" . get_current_user() . "/public_html/clientexec/ioncube/ioncube_loader_lin_4.4.so \n";
$parm[8] = "session.save_path = /home/" . get_current_user() . "/tmp/sessions/ \n";   // user specified temp upload directory 

// full unix path - location of the default php.ini file at your host
// you can determine the location of the default file using phpinfo()
$defaultPath = 'usr/local/Zend/etc/php.ini'; 
// full unix path - location where you want your custom php.ini file
$customPath = "/home/username/public_html/php.ini";
// nothing should change below this line.
if (file_exists($defaultPath)) {
  $contents = file_get_contents($defaultPath); 
  $contents .= "\n\n; USER MODIFIED PARAMETERS FOLLOW\n\n";  
  foreach ($parm as $value) $contents .= $value . " \n";
  $handle = fopen($customPath, 'w'); 
  if (fwrite($handle, $contents)) { 
    fclose($handle);
    if (chmod($customPath,0600)) $message = "The php.ini file has been modified and copied";
      else $message = "Processing error - php.ini chmod failed";
  } else {
    $message = "Processing error - php.ini write failed";
  }
} else {
  $message = "Processing error - php.ini file not found";
}
echo $message;
?>
Will something like this work here too? As i have had no luck using it so far- each time i get the final message telling me "php.ini file not found". Do i have the wrong or something simple like that?

3. A CMS package (drupal) that i use on several different domains requests that 2 different directories (/home/username/tmp/uploads and /home/username/public_html/files) be writeable... I have not been able to figure out how to make these writeable (other than 777 which scares me). I seem to own them, but when drupal (or php maybe) attempts to write to them, i get a error messages saying they are unwriteable. Maybe (i really have no idea) has something to do with PHP running as root vs. as a web-user or???

Basically my question is whether i can (without envoking help desk support for each domain i have that uses drupal or any other php that wants to write to a directory) change directory/file permissions so that php can write to it?

thanks for your time,

noah
noah is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 4th June 2006, 02:30 PM   #2 (permalink)
Dotable Founder
 
Aussie Bob's Avatar
 
Join Date: Mar 2005
Location: Land down under
Posts: 4,070
Default

Quote:
Originally Posted by noah
When a file/directory is created by php or apache, which user (and group) owns it...Or maybe its better to ask which user is apache (and or php) running as?
"nobdy" user, unless php suexec is installed on the server, which it's not.
Quote:
Conversely, if i create a file/directory is there a group that apache/php are in that i can give permission to so that apache/php can write to or read from, without having to 777 the file/directory.

No, it necessary to set 666/777 permissions

Quote:
2. Custom PHP ini? . . . Will something like this work here too? As i have had no luck using it so far- each time i get the final message telling me "php.ini file not found". Do i have the wrong or something simple like that?
Best to drop those specifics into the helpdesk, and we can see what's up.
Quote:
3. A CMS package (drupal) that i use on several different domains requests that 2 different directories (/home/username/tmp/uploads and /home/username/public_html/files) be writeable... I have not been able to figure out how to make these writeable (other than 777 which scares me).
You can't make files writeable other than 777 perms.

Probably best to drop in a ticket to the Dotable helpdesk, if you're having specific issues with php.
__________________
Please review Dotable at the following review sites -

HostJury.com | WebHostingStuff.com
Aussie Bob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 4th June 2006, 09:46 PM   #3 (permalink)
New Dotable member
 
Join Date: May 2006
Posts: 22
Default thanks

Thanks for the info Bob... I will do as you suggest and make use of the helpdesk.
noah is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On



Go Back   Dotable - Dot your Domains > Dotable Support Forum


All times are GMT +10. The time now is 04:28 AM.


Home About Products F.A.Q Network Status Affiliates Support Contact Search Terms

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0