Hi,
I have the following code in my application and it is not working on a certain VPS server and I have no idea why.
Server: Linux - PHP Version 5.3.16
<?php
define('PROJECTS_DIR', '../projects/');
// Gets project names from the projects folder.
function projects() {
$projects = glob(PROJECTS_DIR.'*', GLOB_ONLYDIR);
for ($i=0; $i<count($projects); $i++) {
$projects[$i] = basename($projects[$i]);
}
return $projects;
}
$projects = projects();
if (empty($projects)) {
echo 'No projects found.';
}
?>
The above code works fine on all other servers I tested but not on this one. No error, no output. What could be the reason? What should I check in phpinfo() or php.ini? Something to do with glob()?
Thanks for any ideas.