<?php
if ($handle = opendir('/var')) {
echo "Directory handle: $handle\n";
echo "Entries:\n";
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
echo "$entry\n";
}
closedir($handle);
}
Warning: opendir(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PfcdG on line 3
Warning: opendir(/var): Failed to open directory: Operation not permitted in /in/PfcdG on line 3
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Warning: opendir(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PfcdG on line 3
Warning: opendir(/var): Failed to open directory: Operation not permitted in /in/PfcdG on line 3
Directory handle: Resource id #5
Entries:
.
..
cache
lib
log
empty
games
local
lock
mail
opt
run
spool
tmp
Output for 7.4.26 - 7.4.32
Warning: opendir(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PfcdG on line 3
Warning: opendir(/var): failed to open dir: Operation not permitted in /in/PfcdG on line 3
Output for 5.2.3 - 5.2.17
Directory handle: Resource id #4
Entries:
.
..
cache
lib
log
empty
games
local
lock
mail
opt
run
spool
tmp