Kavya Shree Kavya Shree - 1 year ago 91
PHP Question

Why is_dir() function is not checking case sensitive in CPanel server

I tried this code in localserver, It works correcly if my directory is having that foldername already and it won't accept the same folder to create, but if I uploaded the part in server.

If the directory is having foldername with Alto and new folder I tried name with alto Its just created why is it.

If anyone knows the solution.
enter image description here

if (!is_dir("../../".$folder_type."/".$folder_name)) {
$content = file_get_contents('../../default_code.php');
$fp = fopen($path . "/$folder_name.php","wb");
echo "0";
chmod("../../".$folder_type."/".$folder_name, 0777);

Answer Source

To rule out this condition at all. Please use strtolower when creating a directory. That means use this:


Like this in future, your all folders will be in lowercase and there would be no chance of contradiction.

I hope it helps

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download