include file.php from an other account with fastcgi

Hello, I have 2 virtual servers running php as FCGId:

domain: app-base.com home: /home/appbase user: appbase (1001) group: appbase (1001) domain: app-demo.com home: /home/appdemo user: appdemo(1002) group: appdemo(1002)

I need to include /home/appbase/config.php in /home/appdemo/public_html/test.php.

I this posible? What options do I have?

I tried to setup the same group to each virtual-server and modify SuexecUserGroup, but doesn’t work. (500 Internal Server Error)

Howdy,

Well, although you may not be able to run that .php code, you should certainly be able to just read it.

You would just need to make sure that the appbase user has rights to read that file… you would want to verify that using the command line.

If you’re getting 500 errors, you may want to take a peek at the error logs in $HOME/logs/error_log to see what’s going awry.

-Eric

Reviewing the error log, I found: Connection reset by peer: mod_fcgid: error reading data from FastCGI server

The problem was the user/group of /home/$user/fcgi-bin/php5.fcgi. I found the solution here: http://www.virtualmin.com/node/22214

Now I can include php files from the other virtual server.

Is there any concern about changing the group of a virtual-servers owner, like I did?

Howdy,

Well, another way to do that would be to add their current group to a new group. Or change another user to use the Virtual Server’s group (rather than vice-versa).

It’s possible that some components could get confused if the group were changed, it might be simpler to do one of the above.

But is it possible to change the Virtual Server’s group? Probably… I haven’t tried that before, and it may take a little tinkering to get it working. But it, in theory, should be possible to get that to work :slight_smile:

-Eric

Guys, im with the same problem…
Idk what to do…

can any1 tell me how to do that? i suck on linux, sorry =\

My site is:
http://commons.garotacarioca.tk/ (/home/garotacarioca/commons)
- the apache user is: garotacarioca on group “common”
tries to acess: /home/admin/file.php
- user admin on group “common” too

what i did:

  • putted every user on the same group (files and folders too)
  • tried to force with 0777 in all folder and files
  • Included my base dir, in php.ini “/home/admin”
    (here worked, cuz if i call is_dir(/home/admin/xpto_folder) works ^^
  • for the last try, ive tried the include_path …

nothing worked =\

please, any1 gimme some light!!!

thanks a lot!