PDA

View Full Version : Strange Behaviour of /tmp


gdesclaux
05-09-2001, 12:39 PM
Hi,

I don't really understood the behaviour of the /tmp directory...

I can make this : $tempfile = tempnam("/tmp", "tmpfl");

and because the PHP engine is > 4.0.3 the tempnam function return a temporary name file AND CREATE THE FILE.

BUT : I CANNOT make this : $fd = fopen($tempfile, 'w');

$fd is always FALSE...

So ? What's happen ? Why I cannot read or write in the /tmp with the fopen function ?

It's the same situation with /big/dom/tmp

What can we really do in these temp directories ?

Thanks

Neo
05-10-2001, 06:45 PM
Hello, the problem is that in order to preserve data integrity FutureQuest, locks down your account for your safety by including among many security measures the php SAFE_MODE directive, measures that safeguard your data from prying eyes, the "SAFE_MODE" directive prevents others from executing applications or reading / writting to your files (same goes for your so you can not writte out side your document area in your account with php), of course FutureQuest provides the tools for you to be able to get the results you expect that is why there is also support for the cgi version of php...

So if you try your code but instead of using the *.php extension you use the *.cgi and add the &quot;#!/usr/bin/php&quot; (please verify the actual path of the cgi php on you CNC) line at the start of your script (the very first line even before the <? part) and make the file executable chmod 755 your.cgi then you will bypass the &quot;SAFE_MODE&quot; which is only active on the php apache module...

Then you should be able to accomplish what you desire the problematic part is present when you try to issue a write command which is not possible under the php/apache module but it is possible under the php cgi verion...

Hope that helps! :)

------------------
FutureQuest
Staff Member
[This message has been edited by Neo (edited 05-10-01@5:51 pm)]

gdesclaux
05-11-2001, 05:45 AM
Thank you very much !!