-1
I’m having trouble using the mkdir()
inside my vps in the Digital Ocean. I installed the LAMP and I made all the appropriate settings to run my system. However, in the folder creation area, it is not working. Follow the code:
$pasta = 'teste';
$path = '/var/www/meusite.com.br/' . $pasta;
if (!mkdir($path, 0755, true))
{
echo('Não foi possível criar a pasta');
}
else
{
echo('Pasta criada com sucesso!');
}
The return is always FALSE
.
Is there any error variable in this case that I can identify why it cannot create?
Any idea what it might be? I’m using version 7.2 of PHP.
The briefcase
/var/www/meusite.com.br/
have written permission for the group www-data?– Erlon Charles
@Erloncharles really was permission. Permission was only in the user and not in www-data. Thanks for the help friend!
– Marcelo Roberto
I will enter an answer for registration only
– Erlon Charles