Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a dedicated server running php with dso handler, I am including a global config.php from one account into all the other accounts. This works fine on apache when opening the sites via browser.

But I also have some cron jobs, and there i get "permissions denied" error when trying to include the config.php file.

The main config.php is in user1 account, so I tried adding user2 (which includes user1 config.php) to the user1 group, but that didn't worked, the error still persist.

How could I fix it without having to modify all the files that include the main config.php file?

UPDATE:

i "fixed" it by adding the user2 to the nobody group. It seems to work fine, but could it generate some other problems?

share|improve this question

1 Answer 1

Every web server uses Effective uid and gid ,

Definition :

Effective username and group name are defined in /etc/passwd and /etc/group

For example apache on Debian distro uses www-data group and www-data user. You should set your web data to them.Such as :

chown www-data.www-data YOURROOTDIR/ -R

Suggestion :

You should find out to how set your distro its effective uid and gid.Then act to chown.Because each distro uses one effective uid and gid.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.