/tmp/ writeable and chmod of /home/user/tmp/

khorinis

Well-Known Member
Aug 15, 2010
65
0
56
Hello,
which chmod does /home/*user*/tmp have normaly? It's the tmp folder of cpanel for every statistics.

How could i make /tmp/ writeable for a user? I use suphp (tutorial "convert dso to suphp") and it should be writeable for my webscript because of plugin installation. Chmod must be 755 for folders and 644 for files.
 
Last edited:

khorinis

Well-Known Member
Aug 15, 2010
65
0
56
Hello,
i have got /tmp/ to be writeable for my webscript with handler dso but now i'm using suphp with lower rights. What do i need to change for let my webscript can write and read in /tmp/ as it was when handler were dso?
 

khorinis

Well-Known Member
Aug 15, 2010
65
0
56
Webscript tell me a error that he can't read / create a file in the tmp folder. Folder have chmod 755 and is set as tmp directory.

Error:
package information file 'package.xml' not found in '/home/user/public_html/forum/tmp/package_fe12ae45253a308221193ab059de35210d8a78fc' (13000)

Setting:
Configuration File (php.ini) Path /usr/lib
Loaded Configuration File /home/user/php.ini
upload_tmp_dir /home/user/public_html/forum/tmp /home/user/public_html/forum/tmp
Software is a Burning Board 3.
 
Last edited:

GaryT

Well-Known Member
May 19, 2010
320
3
68
You said tmp as in server side not client side !

If your using suPHP then, The tmp for this should be set to 644 suPHP changes it completly, I tend not to use suPHP as clients were constantly putting in support tickets saying the CHMOD 755 or 777 is not working blah blah and was always telling them about the apache and what rules and so on.. 98% of people who get hosting only know the 755 rules :eek:

I currently use fastCGI - with a very hardend PHP, Yeah not as secure as suPHP but its alot more secure than the standard you get. Plus the performance is there too by using OPcode.

Anyway, 644 should or will do the trick !
 

khorinis

Well-Known Member
Aug 15, 2010
65
0
56
It's creating a file called "package_8f9af8731d9aeab410483ca35fa8dbfe4797c363" at the custom tmp folder but not the package.xml

How i could fix that? Folder chmod tried 644 - still the same.

Maybe someone could check it with me together?
 
Last edited:

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
You said tmp as in server side not client side !

If your using suPHP then, The tmp for this should be set to 644 suPHP changes it completly, I tend not to use suPHP as clients were constantly putting in support tickets saying the CHMOD 755 or 777 is not working blah blah and was always telling them about the apache and what rules and so on.. 98% of people who get hosting only know the 755 rules :eek:

I currently use fastCGI - with a very hardend PHP, Yeah not as secure as suPHP but its alot more secure than the standard you get. Plus the performance is there too by using OPcode.

Anyway, 644 should or will do the trick !
You tend not to use it because why?

If you are not using it, every time someone uploads something to say a Joomla site for example, thru their Joomla site, the file uploaded becomes owned by nobody. When they need to change something, you must go in and help.

If using SuPHP and they need to change a directory from 777 to 755, they can do it themselves.

98%? Can you provide a link to that poll?

The performance hit by SuPHP is not as bad as you might think on todays very fast servers. To me, that very small hit is worth the price.


It's creating a file called "package_8f9af8731d9aeab410483ca35fa8dbfe4797c363" at the custom tmp folder but not the package.xml

How i could fix that? Folder chmod tried 644 - still the same.

Maybe someone could check it with me together?
No folder should be set to 644.

Maybe you could check to be sure you're actually running SuPHP.

In your WHM what does it say on this page for you?

WHM > Service Configuration > Apache Configuration > PHP and SuExec Configuration > PHP 5 Handler
 

khorinis

Well-Known Member
Aug 15, 2010
65
0
56
Current Configuration

Option Configured Value
Default PHP Version (.php files) 5
PHP 5 Handler suphp
PHP 4 Handler none

Apache suEXEC on
I'm using suphp, yes.
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
I'm using suphp, yes.
Great. OK, lets start over then.

Software is a Burning Board 3.
What is it exactly that you're trying to do that won't work? I've got a few minutes to spare. If you can explain more I'll try and reproduce it here on my end on my test server running SuPHP as you are.
 

khorinis

Well-Known Member
Aug 15, 2010
65
0
56
What is it exactly that you're trying to do that won't work?
Last time i got /tmp writeable with handler dso and chmod 777 for the installation. But now i want to install a plugin for Burning Board 3 and when i enter the customer details it's going to install it but with the above told error. Only the package.xml can't get created in the tmp folder. If you want i can give you access to it for try it by yourself. It's the newest version of Burning Board 3 (3.1.3) and it's the plugin "Postingtemplate".
 

khorinis

Well-Known Member
Aug 15, 2010
65
0
56
Burning Board 3.1.3 - paid one.

Plugin / Paket:
PostingTemplate 1.3.1 pl 1 from Tobias Friebel

I've got also root access - not only webspace.
 
Last edited:

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
I won't be able to assist you with this one, sorry.

If your plugin is anything like the installer (I'm assuming it is) for the burning board itself, it's coded to use $_SERVER['DOCUMENT_ROOT'

Not any directory on the user account.

Simply running this installer loads up the server tmp with all sorts of files needed to install this forum software.

A snip from the install.php for burning board.

Code:
class BasicFileUtil {
	/**
	 * Tries to find the temp folder.
	 * 
	 * @return	string
	 */
	public static function getTempFolder() {
		// use tmp folder in document root by default
		if (!empty($_SERVER['DOCUMENT_ROOT'])) {
			if (strpos($_SERVER['DOCUMENT_ROOT'], 'strato') !== false) {
				// strato bugfix
				// create tmp folder in document root automatically
				if (!@file_exists($_SERVER['DOCUMENT_ROOT'].'/tmp')) { 
					@mkdir($_SERVER['DOCUMENT_ROOT'].'/tmp/', 0777);
					@chmod($_SERVER['DOCUMENT_ROOT'].'/tmp/', 0777);
				}
			}
			if (@file_exists($_SERVER['DOCUMENT_ROOT'].'/tmp') && @is_writable($_SERVER['DOCUMENT_ROOT'].'/tmp')) {
				return $_SERVER['DOCUMENT_ROOT'].'/tmp/';
			}
		}
		
		if (isset($_ENV['TMP']) && @is_writable($_ENV['TMP'])) {
			return $_ENV['TMP'] . '/';
		}
		if (isset($_ENV['TEMP']) && @is_writable($_ENV['TEMP'])) {
			return $_ENV['TEMP'] . '/';
		}
		if (isset($_ENV['TMPDIR']) && @is_writable($_ENV['TMPDIR'])) {
			return $_ENV['TMPDIR'] . '/';
		}
The problem you're having is not a cPanel problem, its the software.

You'll need to either contact your host, or burning bored support I would think you pay for with the paid version of this software, or the plugin developer for help on this one.

You might also want to clean up your servers tmp directory. (cautiously, you can kill MySQL if you delete the sock file. And there may be other files or directories there you don't want to touch as well)

I would not suggest this forum software to anyone, myself. I'm sorry.