A couple of things here for linux redhat/plesk folks:
When you run chmod you are setting the permissions on the files.
However, in the past I have had to use chown (change ownership) because I loaded and chmod'ed the files as root, not as apache user.
You might need to run chown like this to give the apache web server the rights to access the files:
chown -R apache:apache *.*
chown -R nobody:nobody *.* (sometimes the apache user is nobody)
the -R will recurse into any sub-dirs you might have created.
check your files to make sure with:
You should see the apache:apache ownership
restart apache (you can do this with the plesk tool)
and now moodle (apache) should have access to your directories.
Also, if you are on a virtual server, you will need to set the openbasedir directive in your vhost.conf in your conf directory (below the web root) like this.
Here is the contents of vhost.conf file:
php_admin_value open_basedir none
NOTE: once you set the openbasedir you will need to restart apache as well...