- dirname: documentation ( source)
- ini_set: documentation ( source)
- fclose: documentation ( source)
- fopen: documentation ( source)
<?php
// no separator
$dir = '/tmp/';
ini_set('open_basedir', $dir);
print("ini_set to ".$dir."\n");
$fp = fopen('/tmp/hhvm-openbasedir-test', 'w');
if ($fp) {
print("Opened!\n");
fclose($fb);
} else print("Failed to open\n");
// with separator
$dir = dirname(PHP_BINARY);
ini_set('open_basedir', $dir);
print("ini_set to ".$dir."\n");
$fp = fopen('/tmp/hhvm-openbasedir-test', 'w');
if ($fp) {
print("Opened!\n");
fclose($fb);
} else print("Failed to open\n");
// with separator
$dir = '/tmp/'.PATH_SEPARATOR.dirname(PHP_BINARY);
ini_set('open_basedir', $dir);
print("ini_set to ".$dir."\n");
$fp = fopen('/tmp/hhvm-openbasedir-test', 'w');
if ($fp) {
print("Opened!\n");
fclose($fb);
} else print("Failed to open\n");