Share php files

9 posts / 0 new
Last post
#1 Tue, 09/20/2011 - 10:09
riking

Share php files

Hi, I am hoping someone out there will be able to help me.

On our webserver we set up a couple of subdomains.

I want to be able to share the main functions.php to all the subdomains, saves duplication.

This used to work until the server crashed and i re-installed virtualmin.

for example.

<?php
    include('/home/intranet/public_html/classes/test_include.php');
?>

gives the following errors Warning: include(/home/intranet/public_html/classes/test_include.php) [function.include]: failed to open stream: Permission denied in /home/salesman/public_html/test_include.php on line 2

Warning: include() [function.include]: Failed opening '/home/intranet/public_html/classes/test_include.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/salesman/public_html/test_include.php on line 2

I have searched the web and can not find a solution. can someone please help.

Thanks

Rob

Tue, 09/20/2011 - 10:15
andreychek

Howdy,

Well, it sounds like you're running into a permission issue of some sort.

Are all the domains you're trying to load that content from located within the "/home/intranet" account? Or are they part of other accounts on the system?

-Eric

Tue, 09/20/2011 - 10:19
riking

ps i have checked that the file has 0777.

Tue, 09/20/2011 - 10:27
riking

Hi Eric,

They are all different accounts and which are different users and group.

Thanks Rob

Tue, 09/20/2011 - 10:30
andreychek

Aha.. I suspect the issue is related to directory permissions. One of the directories in the "/home/intranet/public_html/classes/" path isn't likely accessible to the world.

My guess is that it's "/home/intranet" in particular.

Try running:

chmod +x /home/intranet

After that, are you able to access your shared PHP?

-Eric

Tue, 09/20/2011 - 11:12
riking

Thats great, Thanks you so so much :)

Fri, 08/04/2017 - 01:13
santicabanillas

Is secure give permision 751 (other: enter and execute) to /home/somefolder? I have the same situation as "riking"

I have 3 diffrent accounts: - home/account-1 - home/account-1/domains/account-3 - home/account-2

I have a file php with critical information like user/pass for db access I need share this file with these 3 accounts The file is located: in home/account-2/api/functions.php

Setting 751 to home/account-2 and home/account-2/api Can share home/account-2/api/functions.php

Another question is who has access to home folder? root and all user created by root has access to home folder, someone else?

Thanks

Fri, 08/04/2017 - 04:28 (Reply to #7)
Joe
Joe's picture

750 is usually all that is needed.

--

Check out the forum guidelines!

Fri, 08/04/2017 - 07:42
santicabanillas

Hi Joe, If set 750, home/account-1& home/account-1/domains/account-3 can't include('home/account-2/api/functions.php')

Topic locked