From 5096589d6ef7a64edb6a38cbfec70b8b3dd0603e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 5 Dec 2001 17:48:48 +0000 Subject: [PATCH] faq safe mode --- ChangeLog | 1 + Documentation.html | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9dc267664..71ec1151e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ $Source$ 2001-12-05 Marc Delisle * lang/norwegian.inc.php3 updates thanks to Sven-Erik Andersen + * Documentation.html: faq entry about safe mode and uploads 2001-12-04 Loïc Chapeaux * config.inc.php3; Documentation.html; left.php3; diff --git a/Documentation.html b/Documentation.html index 50eb22d3d..1ea2b41bb 100755 --- a/Documentation.html +++ b/Documentation.html @@ -867,20 +867,25 @@

- I try to insert a text file in a table, and I get:
- Error MySQL said: The file '/tmp/phpkvpp60' must be in the database - directory or be readable by all
+ I cannot insert a text file in a table, and I get an error + about safe mode being in effect.
Your uploaded file is saved by PHP in the "upload dir", as defined in php.ini by the variable upload_tmp_dir (usually the system default is /tmp). - 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).
- The system administrator can do a "chmod 777 /tmp": then - the MySQL server will accept to read it. Also, the user must have - File privilege. + We recommend the following setup for Apache servers running in + safe mode, to enable uploads of files while being reasonably secure: +
+

    +
  • create a separate directory for uploads: + mkdir /tmp/php
  • +
  • give ownership to the Apache server's user.group: + chown apache.apache /tmp/php
  • +
  • give proper permission: chmod 600 /tmp/php
  • +
  • put upload_tmp_dir = /tmp/php in php.ini
  • +
  • restart Apache
  • +