PHP Safe Mode Fix
- Status
- Open
- Subject
- PHP Safe Mode Fix
- Version
- 9.x
- Category
- Error
- Feature
- Installer (profiles, upgrades and server-related issues)
- Resolution status
- Out of Date
- Submitted by
- alien
- Lastmod by
- Ushindi Gedeon
- Rating
- Description
The install fails if the server is running php safe mode. There are several references to this issue with work-arounds that didn't work for me (ex. http://twbasics.tikiforsmarties.com/Fixing+Installation+Problems).
The problem (at least for me) was that I do not have access to /tmp. It turns out to be related to a bit of code in initlib.php that doesn't check for an empty tempdir. I added additional code return ./tmp (and create it if necessary). See below. Code is commented "Safemode Fix".
static function tempdir()
{
static $tempdir;
if (!$tempdir) {
$tempfile = @tempnam(false, '');
$tempdir = dirname($tempfile);
@unlink($tempfile);
__ // Safemode Fix
if (!$tempdir) {
$tempdir = "./tmp";
if (!is_dir($tempdir)) {
mkdir($tempdir);
}
}__}
return $tempdir;
}- Solution
- Workaround
- Importance
- 5
- Priority
- 25
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 4319
- Created
- Monday 22 October, 2012 15:23:54 UTC
by alien - LastModif
- Saturday 04 July, 2026 21:07:10 UTC