To expand on Slilibri's answer there are a few ways to grant mkdir permissions for Apache and the underlying user (most often www-data but can also be Apache depending on the distro)
Will change the owner of the folder to apache granting R/W/E to the folder and its subfolders but may ruin other programs access to the folder. the -R is optional but if the script wants to create subfolders it may be necessary, if apache is the only one using the folder this would be the best setup.
chown -R www-data folder
Will change the group of the folder but not the owner, this may be enough to create folders but depending on the security settings of the folder it may not.
if you run the command
#ls -l
drwxrwxr-x 3 root admin 102 19 May 2009 httpd
The first string of numbers represent the security settings on that file/folder. the d means its a folder, the first r means the owner can read that file/folder, the 2nd r means that the group can read that folder and the 3rd r means everyone can read that folder. the same theory applies to the x, the first x means the owner can execute the file/folder ect....
the w means write, the first and second w allow write access to the owner and group but the 3rd w is replaced with a '-', as the 3rd letter specifies everyone, this means everyone but the owner and group members can write to this file/folder.
to allow everyone to read/write/execute you can use this command.
chmod -R 777 folder
better settings are 775 though, 775 allows read/write to only members of the group and the owner, its more secure.