0
PHPディレクトリリストが機能しません。何が間違っていますか?ムービーディレクトリにフォルダがありますが、出力に表示されません。PHPディレクトリリストが機能しない
<?php
// declare the folder
$ourDir = "movies";
// prepare to read directory contents
$ourDirList = @opendir($ourDir);
// loop through the items
while ($ourItem = readdir($ourDirList))
{
// check if it is a directory
if (is_dir($ourItem))
{
echo $ourItem;
echo "<br />";
}
}
closedir($ourDirList);
?>
php''のerror_reporting(E_ALL)を追加;?ini_set( 'はdisplay_errors'、1); 'とopendir''から '@'を削除し、再度 –
をあなたのスクリプトを実行して確認してください、私はあなたを試してみました提案。私はエラーはなく、まだディレクトリリストはありません。ムービーフォルダはPHPスクリプトと同じディレクトリにあります(ムービーフォルダ内に空のフォルダが2つあります)。 – dreadycarpenter
'movies'フォルダのアクセス許可を確認してください(077にする必要があります) –