| 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. |
![]() |
| Host one domain | Multiple domains | Reseller accounts | VPS accounts | Dedicated servers | Register domains | Backup space |
|
|
#1 (permalink) |
|
New Dotable member
Join Date: May 2006
Posts: 22
|
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;
?>
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 |
|
|
|
|
|
#2 (permalink) | ||||
|
Dotable Founder
Join Date: Mar 2005
Location: Land down under
Posts: 4,070
|
Quote:
Quote:
No, it necessary to set 666/777 permissions Quote:
Quote:
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
|
||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
|
|||||||