faq safe mode

This commit is contained in:
Marc Delisle
2001-12-05 17:48:48 +00:00
parent dcc3a51065
commit 5096589d6e
2 changed files with 15 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ $Source$
2001-12-05 Marc Delisle <lem9@users.sourceforge.net>
* lang/norwegian.inc.php3 updates thanks to Sven-Erik Andersen
* Documentation.html: faq entry about safe mode and uploads
2001-12-04 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* config.inc.php3; Documentation.html; left.php3;

View File

@@ -867,20 +867,25 @@
</p>
<p>
<b>I try to insert a text file in a table, and I get: <br />
Error MySQL said: The file '/tmp/phpkvpp60' must be in the database
directory or be readable by all</b>
<b>I cannot insert a text file in a table, and I get an error
about safe mode being in effect.</b>
<br />
Your uploaded file is saved by PHP in the &quot;upload dir&quot;, as
defined in <i>php.ini</i> by the variable <tt>upload_tmp_dir</tt> (usually
the system default is <i>/tmp</i>).
If this directory is not readable by all, the MySQL server (which must be
running on the same machine) cannot open the file (except if running as
root, which is not recommended).
<br />
The system administrator can do a &quot;<tt>chmod 777 /tmp</tt>&quot;: then
the MySQL server will accept to read it. Also, the user must have
<tt>File</tt> privilege.
We recommend the following setup for Apache servers running in
safe mode, to enable uploads of files while being reasonably secure:
<br />
<ul>
<li>create a separate directory for uploads:
<tt>mkdir /tmp/php</tt> </li>
<li>give ownership to the Apache server's user.group:
<tt>chown apache.apache /tmp/php</tt> </li>
<li>give proper permission: <tt>chmod 600 /tmp/php </tt> </li>
<li>put <tt>upload_tmp_dir = /tmp/php</tt> in php.ini </li>
<li>restart Apache</li>
</ul>
</p>
<p>