Re: include_path related issue



shimmyshack wrote:
On Apr 24, 4:34 pm, Schraalhans Keukenmeester <bitbuc...@xxxxxxxxxxxx>
wrote:
I suspect the following problem IS hosting provider specific, but they
haven't been able to help me out so far. Perhaps I am doing something
wrong and someone is able to spot the issue... Here goes.

The actual path of the root dir of my account with hosting provider
(H.P.) is:
/usr/local/psa/home/vhosts/mydomain.com/
The webroot is a subdir of the root:
/usr/local/psa/home/vhosts/mydomain.com/httpdocs.
Include files go in:
/usr/local/psa/home/vhosts/mydomain.com/includes.
.htaccess in httpdocs contains:
php_value include_path ".|../includes"

I can specify additional subdomains in the control panel of my account.
They automatically go in
/usr/local/psa/home/vhosts/mydomain.com/subdomains/
One of these:
/usr/local/psa/home/vhosts/mydomain.com/subdomains/customer
which also has the subdirs 'httpdocs' and 'includes'
To browse httpdocs/index.php the subdomain the URL reads:
http://customer.mydomain.com[/index.php]
The .htaccess file in httpdocs is similar to the one in my master domain.
PHP recognizes the include_path setting properly, yet fails to open ANY
file in the includes directory (e.g.):
Fatal error: main() [function.require]: Failed opening required
'dbconn.inc' (include_path='.:../includes') in
/usr/local/psa/home/vhosts/mydomain.com/subdomains/customer/httpdocs/counter.php
on line 4

Permissions are set along the same lines for both master and
sub-domains, 'r-x' to others for all subdirs involved, 'r--' for the files.

Any ideas what prevents PHP from opening include files for my
subdomains? Open_basedir is set to my root dir btw by H.P., if that
makes any difference for this issue.

Hope my message is readable enough. Thanks in advance!
Sh.

the short answer is not to reply on the includes directive/.htaccess
files, just define the application include root (and any and all other
paths your application needs) for yourself in your php application and
then prefix any attempt to open an include with that definition. Your
application becomes more portable as it doesnt reply on the ability to
set the includes dir in an .htaccess file. that's what i would do
anyway!

Valid point, I'll make sure all stuff in my main domain uses that
solution instead. The .htaccess solution only existed in my 'testlab'.
However, in this case that doesn't seem to be the culprit. PHP has the
include path right, just isn't able to open any files in it.

Right now a 2nd helpdesk employee is modifying some configs to make
things work, he thinks he has the solution. Once fixed, I'll ask him
what exactly caused this behavour, I'll report back here.

Thanks for the input.
Sh.
.



Relevant Pages

  • Re: include_path related issue
    ... The actual path of the root dir of my account with hosting provider ... I can specify additional subdomains in the control panel of my account. ... which also has the subdirs 'httpdocs' and 'includes' ... PHP recognizes the include_path setting properly, ...
    (comp.lang.php)
  • Re: Site root question: Newbie
    ... That was a variable that only sits in front of all of the site includes, all of the root-relative links in the site are still looking at http://www.site.com/ as the root rather than http://www.site.com/client/dev/2006/. ... and that is the root folder. ... In all of the PHP sites I've seen there are always a couple of folder levels outside the web site root and these seem to contain necessary php files like pear, and setting root-relative links, especially with include files, can be a real pain, in my limited experience. ... For security reasons you may not want it to be possible for someone outside the server to execute some scripts, those you place outside the root for the website, this way no one can use an url and try to run a script. ...
    (alt.php)
  • RE: Linux hacked
    ... Was any of the sites running a php nuke or another portal or system that is vuln ... been able to use that with a locla root exploit to gain root on the machine. ... > hack the box, pull the drive and save it. ... > Use the newest versions of Gentoo, Apache, SSH, PHP and Squirl Mail. ...
    (Security-Basics)
  • Re: idiot question about chown
    ... > I want to chown htdocs. ... I want htdocs to belong to the same user as ... Apparently PHP is running as root. ...
    (alt.linux)
  • Re: Starting mysql and sendmail [solved]
    ... > The root user is already installed, it just has no password set. ... > Better avoid using PHP's mailfunction. ... > around typical problem when trying to create valid mails from PHP. ... I guess I just needed Alexander ...
    (Fedora)