I'm running this script:
$dir = 'images';
if (!file_exists($dir) ) {
mkdir ($dir, 0644);
}
It returns this error:
Warning: mkdir(): Permission denied in /opt/bitnami/apache2/htdocs/file.php on line xx.
Apperently i do not have the rights to create the folder. I found the following:
- htdocs has chmod set to 755
- The owner of htdocs is daemon (lrwxrwxrwx 1 daemon daemon 27 Aug 1 12:16 htdocs -> /opt/bitnami/apache2/htdocs)
- I created a file with php while temp. using chmod 777 and then used this script: https://stackoverflow.com/a/7771686/1139465 to figure out the owner, that was daemon (Array ( [name] => daemon [passwd] => x [uid] => 1 [gid] => 1 [gecos] => daemon [dir] => /usr/sbin [shell] => /bin/sh ) done)
I have an intallation of the Bitnami LAMP solution.