How create dir with php/centos 7? hosted witch aws EC2
i try:
exec('sudo mkdir -p /nome_da_pasta');
shell_exec('sudo mkdir -p /nome_da_pasta');
mkdir("/nome_da_pasta", 0777);
drwxrwxrwx. 8 ec2-user ec2-user 104 May 8 21:56 .
drwxr-xr-x. 12 ec2-user root 183 May 8 12:02 ..
drwxrwxrwx. 4 ec2-user ec2-user 4.0K May 8 21:31 admin
drwxrwxrwx. 4 ec2-user ec2-user 4.0K May 9 01:04 cliente
drwxrwxrwx. 3 ec2-user ec2-user 4.0K May 8 21:31 loja
drwxrwxrwx. 3 ec2-user ec2-user 17 May 8 12:20 pHpServer
drwxrwxrwx. 3 ec2-user ec2-user 17 May 8 12:09 pHpServer-ADm
drwxrwxrwx. 3 ec2-user ec2-user 17 May 8 12:15 pHpServer-PG
need create dir with php on hosted aws ec2
in ssh work, in php not work
PHP:
$cmd = '/bin/bash /usr/local/nginx/html/pHpServer-PG/api/dir.bash';
echo $cmd;
shell_exec($cmd);
BASH:
#!/bin/bash
/usr/bin/sudo mkdir -p nome_da_pasta